actions[] = $irc->registerActionhandler(SMARTIRC_TYPE_CHANNEL|SMARTIRC_TYPE_QUERY, '^!quit$', $this, 'quit'); $this->actions[] = $irc->registerActionhandler(SMARTIRC_TYPE_CHANNEL|SMARTIRC_TYPE_QUERY, '^!reconnect$', $this, 'reconnect'); $this->actions[] = $irc->registerActionhandler(SMARTIRC_TYPE_CHANNEL, '^!time$', $this, 'time'); $this->actions[] = $irc->registerActionhandler(SMARTIRC_TYPE_CHANNEL, '^!date$', $this, 'time'); } function module_exit(&$irc) { foreach ($this->actions as $value) { $irc->unregisterActionid($value); } } function quit(&$irc, &$data) { global $bot; if ($bot->master == $data->nick) { $irc->disconnect(); exit; } } function reconnect(&$irc, &$data) { global $bot; if ($bot->master == $data->nick) { $irc->reconnect(); } } function time(&$irc, &$data) { $irc->message(SMARTIRC_TYPE_CHANNEL, $data->channel, "Date & Time: " . date("r")); } } ?>