X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=app%2FModels%2FChatLog.php;h=6af158784247045dcd4c6c4a0e0fcdbbbe2f5f9f;hb=6a1dfa72436b2f5e5b34485da7d7ef1053d89ccc;hp=d5fc76d9325c565b803ec16eaa92c465366822ac;hpb=6a643908d58f26272c2095616514a140e7c0b4c0;p=alttp.git diff --git a/app/Models/ChatLog.php b/app/Models/ChatLog.php index d5fc76d..6af1587 100644 --- a/app/Models/ChatLog.php +++ b/app/Models/ChatLog.php @@ -79,11 +79,13 @@ class ChatLog extends Model { public static function isKnownBot($nick) { return in_array(strtolower($nick), [ + 'a_n_i_v', 'birrellthesquirrel', 'funtoon', 'nidbot2000', 'nightbot', 'pokemoncommunitygame', + 'sery_bot', 'speedgaming', 'starbase47', 'streamelements', @@ -97,7 +99,6 @@ class ChatLog extends Model { protected function evaluateChannel() { if (empty($this->params)) { - $this->channel()->associate(null); return; } $cname = $this->params[0]; @@ -105,7 +106,12 @@ class ChatLog extends Model { $cname = '#'.$cname; } $channel = Channel::firstWhere('twitch_chat', '=', $cname); - $this->channel()->associate($channel); + if (!is_null($channel)) { + $this->channel()->associate($channel); + if (empty($this->twitch_category) && now()->sub(15, 'minute')->isBefore($this->created_at)) { + $this->twitch_category = $channel->twitch_category; + } + } } protected function detectLanguage() {