From d2e290f1264425f9b01fffd8943717dafe6867a2 Mon Sep 17 00:00:00 2001 From: Daniel Karbach Date: Fri, 19 Jan 2024 18:14:18 +0100 Subject: [PATCH] min msg age for chat bot --- 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 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; } -- 2.39.2