Source code raw phps
<?php
require_once 'modules/class.Module.php';
class Module_Perform extends Module {
protected $_channels = array();
public function __construct()
{
foreach(func_get_args() as $arg) {
if (preg_match('/^#[a-z0-9._-]+$/', $arg)) {
$this->_channels[] = $arg;
}
}
}
public function update(Observed $bot, $raw, $type) {
if (($type & Bot::U_INPUT) != Bot::U_INPUT) {
return Bot::E_CONTINUE;
}
$raw_pieces = explode(' ', $raw);
if ($raw_pieces[1] == '376' && !empty($this->_channels)) { // end of motd
$bot->send('JOIN '.implode(',',$this->_channels));
}
return Bot::E_CONTINUE;
}
}
Comments
There is currently no comment here.