X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;ds=sidebyside;f=app%2FTwitchBot%2FTwitchBot.php;fp=app%2FTwitchBot%2FTwitchBot.php;h=c8d77a36d6f656007a0b3b50c009689b55f3adbe;hb=8fd3830c342ed7734280407b03cc7ced6e116b10;hp=a45de87fcce69a36b32e06cdb2fc567b222144a0;hpb=31127000e16c18389129546b9aa652de565683fb;p=alttp.git diff --git a/app/TwitchBot/TwitchBot.php b/app/TwitchBot/TwitchBot.php index a45de87..c8d77a3 100644 --- a/app/TwitchBot/TwitchBot.php +++ b/app/TwitchBot/TwitchBot.php @@ -99,10 +99,6 @@ class TwitchBot { public function handleIRCMessage(IRCMessage $msg) { $this->last_contact = time(); - if ($msg->isPrivMsg()) { - $this->handlePrivMsg($msg); - return; - } if ($msg->isPing()) { $this->sendIRCMessage($msg->makePong()); return; @@ -110,6 +106,11 @@ class TwitchBot { if ($msg->isPong()) { return; } + $msg->log(); + if ($msg->isPrivMsg()) { + $this->handlePrivMsg($msg); + return; + } if ($msg->isNotice() && $msg->getText() == 'Login authentication failed') { $this->logger->notice('login failed, refreshing access token'); $this->token->refresh(); @@ -126,7 +127,7 @@ class TwitchBot { public function handlePrivMsg(IRCMessage $msg) { $target = $msg->getPrivMsgTarget(); - if ($target[0] != '#') return; + if ($target[0] != '#') return; // direct message $text = $msg->getText(); if ($text[0] != '!') return; $channel = Channel::firstWhere('twitch_chat', '=', $target);