From: Daniel Karbach Date: Fri, 19 Jan 2024 17:14:18 +0000 (+0100) Subject: min msg age for chat bot X-Git-Url: https://git.localhorst.tv/?a=commitdiff_plain;h=d2e290f1264425f9b01fffd8943717dafe6867a2;hp=85879ea0c27ce6506919e2c083a139c470c0952c;p=alttp.git min msg age for chat bot --- diff --git a/app/TwitchBot/TwitchChatBot.php b/app/TwitchBot/TwitchChatBot.php index 0469fbc..5864c5f 100644 --- a/app/TwitchBot/TwitchChatBot.php +++ b/app/TwitchBot/TwitchChatBot.php @@ -77,7 +77,11 @@ class TwitchChatBot extends TwitchBot { } private function randomMsg(Channel $channel) { - $line = ChatLog::where('type', '=', 'chat')->where('banned', '=', false)->inRandomOrder()->first(); + $line = ChatLog::where('type', '=', 'chat') + ->where('banned', '=', false) + ->where('created_at', '<', now()->sub(1, 'day')) + ->inRandomOrder() + ->first(); return $line->text_content; }