X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=app%2FTwitchBot%2FTwitchAppBot.php;h=a103a8847316c3ff8595a85a13a5459ea94e1f1b;hb=7414634d59c94fc5fa2cf9c080324e6c901fa1c9;hp=13499f5d46b38d5913e3994e43ce09dc43250a15;hpb=8645b77ea2dc402f0265e1c8022ba18302506ca1;p=alttp.git diff --git a/app/TwitchBot/TwitchAppBot.php b/app/TwitchBot/TwitchAppBot.php index 13499f5..a103a88 100644 --- a/app/TwitchBot/TwitchAppBot.php +++ b/app/TwitchBot/TwitchAppBot.php @@ -41,16 +41,17 @@ class TwitchAppBot extends TwitchBot { public function handleChatCommand(Channel $channel, IRCMessage $msg) { $cmd = explode(' ', ltrim($msg->getText(), '!'), 2); - if (!isset($channel->chat_commands[$cmd[0]])) return; - $config = $channel->chat_commands[$cmd[0]]; - $this->getLogger()->info('got command '.$cmd[0].' on channel '.$channel->title); + $cmd_name = strtolower($cmd[0]); + if (!isset($channel->chat_commands[$cmd_name])) return; + $config = $channel->chat_commands[$cmd_name]; + $this->getLogger()->info('got command '.$cmd_name.' on channel '.$channel->title); try { $command = ChatCommand::create($this, $channel, $config); if ($command->checkAccess($msg)) { $command->execute($cmd[1] ?? ''); } } catch (\Exception $e) { - $this->getLogger()->warning('error executing command '.$cmd[0].' on channel '.$channel->title.': '.$e->getMessage()); + $this->getLogger()->warning('error executing command '.$cmd_name.' on channel '.$channel->title.': '.$e->getMessage()); } }