]> git.localhorst.tv Git - alttp.git/blobdiff - app/Models/Channel.php
chat bot protocol ui
[alttp.git] / app / Models / Channel.php
index 5c7ae70c0e95ebfec714052becfc28580dc1f354..8af6a7d43e201e191651a4ab9b28fc7c11642ec5 100644 (file)
@@ -32,10 +32,9 @@ class Channel extends Model {
        }
 
        public function randomOfClass($class) {
-               $line = $this->queryChatlog()
+               return $this->queryChatlog()
                        ->where('classification', '=', $class)
                        ->first();
-               return $line ? $line->text_content : '';
        }
 
        public function queryChatlog() {
@@ -241,6 +240,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);
        }