X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=app%2FModels%2FTwitchBotCommand.php;h=6dc5a218087a8530103a4f998b9ed42fcc32a91e;hb=07a88747f8a252b41b739185fcb68bdee3a60f9a;hp=716b8d5841cd1c2c628d6ddff5b1b0b623567c4f;hpb=06fbdc15c8db57590c9b6a38ee1f00d5f349cff9;p=alttp.git diff --git a/app/Models/TwitchBotCommand.php b/app/Models/TwitchBotCommand.php index 716b8d5..6dc5a21 100644 --- a/app/Models/TwitchBotCommand.php +++ b/app/Models/TwitchBotCommand.php @@ -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); }