];
}
$this->startTimer();
+ $this->listenCommands();
}
public function joinChannels() {
}
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'))
+ ->where(function ($query) use ($channel) {
+ $query->whereNull('detected_language');
+ $query->orWhereIn('detected_language', $channel->languages);
+ })
+ ->inRandomOrder()
+ ->first();
return $line->text_content;
}
}
private function randomWaitTime(Channel $channel) {
- return random_int(1, 1800);
+ return random_int(1, 900);
}
private function tagChannelRead(Channel $channel) {