From dad6b0fb3aa0b069aa0481299a98da0ea3ca8d73 Mon Sep 17 00:00:00 2001 From: Daniel Karbach Date: Fri, 14 Nov 2025 18:07:07 +0100 Subject: [PATCH] prefer adlib in response to questions --- app/TwitchBot/TwitchChatBot.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/TwitchBot/TwitchChatBot.php b/app/TwitchBot/TwitchChatBot.php index 9ad2385..5443394 100644 --- a/app/TwitchBot/TwitchChatBot.php +++ b/app/TwitchBot/TwitchChatBot.php @@ -95,6 +95,10 @@ class TwitchChatBot extends TwitchBot { // don't immediately respond if we crossed the msg threshold last return; } + if ($this->getLatestMessage($channel)->classify() == 'question' && $this->shouldAdlib($channel)) { + $this->performAdlib($channel); + return; + } $text = $this->contextualMsg($channel); if (!$text && $this->shouldAdlib($channel)) { $this->performAdlib($channel); @@ -364,7 +368,7 @@ class TwitchChatBot extends TwitchBot { $this->notes[$channel->id]['last_special'][$classification] = time(); } - private function getLatestMessage(Channel $channel) { + private function getLatestMessage(Channel $channel): TokenizedMessage { $notes = $this->getNotes($channel); if (!empty($notes['latest_msgs'])) { return $notes['latest_msgs'][count($notes['latest_msgs']) - 1]; -- 2.47.3