Source for file commands.class.php
Documentation is available at commands.class.php
public function __construct(IcqBot &$icqbot, IcqBot_Conf &$conf, WebIcqPro &$proto, IcqBot_Logs &$logs)
$this->icqbot = &$icqbot;
$this->store = $conf->store;
* Add command handler to module
* @param IcqBot_Module $module
* @param string $command Command to handle
* @param array $aliases Aliases for this command
* @return array Commands and Aliases, whick handled
public function addCommand(IcqBot_Module &$module, $command, $aliases = array())
if (!isset ($this->conf->commands[$command]))
$aliases = array($aliases);
foreach($aliases as $alias)
if (isset ($this->conf->commands[$alias]))
if ($this->conf->commands[$command][0] !== $module)
$removeCommands = array();
foreach ($this->conf->commands as $k=> $v)
foreach ($removeCommands as $v)
public function addEvent(IcqBot_Module $module, $event)
if (!isset ($this->conf->events[$event]))
$this->conf->events[$event]= array();
public function removeEvent(IcqBot_Module $module, $event)
foreach ($this->conf->events as $event => $mods)
unset ($this->conf->events[$event][$mod_name]);
public function addTimer(IcqBot_Module $module, $key, $interval, $callback)
$this->conf->timer[get_class($module)][$key] = array('interval'=> $interval, 'callback'=> array(&$module,"Timer_". $callback));
public function removeTimer(IcqBot_Module $module, $key)
foreach ($this->conf->timer[$mod_name] as $key => $value)
unset ($this->conf->cron[$mod_name. '@'. $key]);
unset ($this->conf->timer[$mod_name]);
public function removeAll(IcqBot_Module $module)
$this->proto->setStatus($status);
$this->icqbot->status = $status;
public function sendMsg($uin, $msg)
$this->proto->activateOfflineMessages($this->uin);
|