]> git.localhorst.tv Git - alttp.git/blobdiff - app/TwitchBot/TwitchChatBot.php
min msg age for chat bot
[alttp.git] / 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;
        }