bot = $bot; $cmd->channel = $channel; $cmd->config = $config; return $cmd; } public function checkAccess(IRCMessage $msg) { $restrict = $this->getStringConfig('restrict', 'none'); if ($restrict == 'owner') { return $msg->isOwner(); } if ($restrict == 'mod') { return $msg->isMod(); } return true; } public abstract function execute($args); protected function getBooleanConfig($name, $default = false) { return array_key_exists($name, $this->config) ? $this->config[$name] : $default; } protected function getStringConfig($name, $default = '') { return array_key_exists($name, $this->config) ? $this->config[$name] : $default; } protected function listAnd($entries) { return $this->channel->listAnd($entries); } protected function messageChannel($str) { if (empty($str)) return; $msg = IRCMessage::privmsg($this->channel->twitch_chat, $str); $this->bot->sendIRCMessage($msg); } protected $bot; protected $channel; protected $config; } ?>