Source code raw phps
<?php
require_once 'modules/class.Module.php';
class Module_Control extends Module {
public function update(Observed $bot, $raw, $type) {
if (($type & Bot::U_INPUT) != Bot::U_INPUT) {
return Bot::E_CONTINUE;
}
$raw_pieces = explode(' ', $raw, 4);
if (!isset($raw_pieces[3])) {
return Bot::E_CONTINUE;
}
$message = substr($raw_pieces[3],1);
if (substr($message,0, 9) == '!control ') {
$command = substr($message, 9);
if (!empty($command) && $command == 'shutdown') {
$bot->notify('Mod_Control ordered a general shutdown.', Bot::U_DEBUG);
return Bot::E_STOP;
} else if (!empty($command) && $command == 'reconnect') {
$bot->notify('Mod_Control ordered a reconnect.', Bot::U_DEBUG);
return Bot::E_RECONNECT;
}
}
return Bot::E_CONTINUE;
}
}
Comments
There is currently no comment here.