]> git.localhorst.tv Git - alttp.git/blobdiff - app/Models/Channel.php
improved responses
[alttp.git] / app / Models / Channel.php
index 46155cda710d1c5d0de970a692d84a8fce889924..8045a4194fa529561ba6a091c0aa7770beb18dce 100644 (file)
@@ -32,6 +32,11 @@ class Channel extends Model {
        }
 
        public function randomOfClass($class) {
+               if (is_array($class)) {
+                       return $this->queryChatlog()
+                               ->whereIn('classification', $class)
+                               ->first();
+               }
                return $this->queryChatlog()
                        ->where('classification', '=', $class)
                        ->first();
@@ -240,6 +245,10 @@ class Channel extends Model {
                return Arr::join($entries, ', ', ' and ');
        }
 
+       public function chat_bot_logs() {
+               return $this->hasMany(ChatBotLog::class);
+       }
+
        public function crews() {
                return $this->hasMany(ChannelCrew::class);
        }