]> git.localhorst.tv Git - alttp.git/blobdiff - app/Models/TwitchBotCommand.php
protocol chat bot messages
[alttp.git] / app / Models / TwitchBotCommand.php
index 716b8d5841cd1c2c628d6ddff5b1b0b623567c4f..6dc5a218087a8530103a4f998b9ed42fcc32a91e 100644 (file)
@@ -48,6 +48,19 @@ class TwitchBotCommand extends Model
                $cmd->save();
        }
 
+       public static function randomChat(Channel $channel, $category, User $user = null, $nick = 'localhorsttv') {
+               $cmd = new TwitchBotCommand();
+               $cmd->command = 'random-chat';
+               $cmd->parameters = [
+                       'channel' => $channel->id,
+                       'category' => $category,
+               ];
+               $cmd->status = 'pending';
+               $cmd->user()->associate($user);
+               $cmd->bot_nick = $nick;
+               $cmd->save();
+       }
+
        public function tournament() {
                return $this->belongsTo(Tournament::class);
        }