X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=app%2FTwitchBot%2FChatCommand.php;fp=app%2FTwitchBot%2FChatCommand.php;h=feea8abf92386c0a6cd1fa1cee66bd55dfeb95c0;hb=cde5d79cf2f09d61fa7b181cd3a1a19050a4aeb3;hp=0000000000000000000000000000000000000000;hpb=898d01d4ac5ccaa23621abda0761a893ff8c1074;p=alttp.git diff --git a/app/TwitchBot/ChatCommand.php b/app/TwitchBot/ChatCommand.php new file mode 100644 index 0000000..feea8ab --- /dev/null +++ b/app/TwitchBot/ChatCommand.php @@ -0,0 +1,44 @@ +bot = $bot; + $cmd->channel = $channel; + $cmd->config = $config; + return $cmd; + } + + public abstract function execute($args); + + protected function getBooleanConfig($name, $default = false) { + return array_key_exists($name, $this->config) ? $this->config[$name] : $default; + } + + protected function messageChannel($str) { + $msg = IRCMessage::privmsg($this->channel->twitch_chat, $str); + $this->bot->sendIRCMessage($msg); + } + + protected $bot; + protected $channel; + protected $config; + +} + +?>