]> git.localhorst.tv Git - alttp.git/commitdiff
min msg age for chat bot
authorDaniel Karbach <daniel.karbach@localhorst.tv>
Fri, 19 Jan 2024 17:14:18 +0000 (18:14 +0100)
committerDaniel Karbach <daniel.karbach@localhorst.tv>
Fri, 19 Jan 2024 17:14:18 +0000 (18:14 +0100)
app/TwitchBot/TwitchChatBot.php

index 0469fbc324ccf55abeb230bad13b009fd4aeb4bf..5864c5f6beeb392cb21926c5ef544224eb32e4e0 100644 (file)
@@ -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;
        }