X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;ds=sidebyside;f=app%2FTwitchBot%2FTwitchChatBot.php;h=576bf04a9dfdcf8b938598b3d129f8b3f2869c8b;hb=cce68689529251915af11ade10699ffa74cb6a3b;hp=5864c5f6beeb392cb21926c5ef544224eb32e4e0;hpb=d2e290f1264425f9b01fffd8943717dafe6867a2;p=alttp.git diff --git a/app/TwitchBot/TwitchChatBot.php b/app/TwitchBot/TwitchChatBot.php index 5864c5f..576bf04 100644 --- a/app/TwitchBot/TwitchChatBot.php +++ b/app/TwitchBot/TwitchChatBot.php @@ -80,6 +80,10 @@ class TwitchChatBot extends TwitchBot { $line = ChatLog::where('type', '=', 'chat') ->where('banned', '=', false) ->where('created_at', '<', now()->sub(1, 'day')) + ->where(function ($query) use ($channel) { + $query->whereNull('detected_language'); + $query->orWhereIn('detected_language', $channel->languages); + }) ->inRandomOrder() ->first(); return $line->text_content; @@ -90,7 +94,7 @@ class TwitchChatBot extends TwitchBot { } private function randomWaitTime(Channel $channel) { - return random_int(1, 1800); + return random_int(1, 900); } private function tagChannelRead(Channel $channel) {