bind_all

Name

bind_all -- Binds all input to a given method

Synopsis

void bind_all(string method);

Description

When any input on the IRC connection is recieved a method bound here will be called. This includes MOTD's, bans and so on.

Example 3-1. Log module for raw IRC input logging

class MyModule extends Wollabot_Module {

  var $fp;

  function MyModule () {
    $this->bind_all('do_logging');
    $fp = fopen("/home/bot/logfile.txt", "a");
  }

  function do_logging ($data) {
    fputs($fp, $data['raw']);
  }

}

$wollabot->register_module("MyModule");