X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=app%2FModels%2FTwitchBotCommand.php;h=e232bdf9a7a1aebdb079fbc7915928469ded9281;hb=e1e352a985c2da1cc0e4ad4716244261445a2604;hp=716b8d5841cd1c2c628d6ddff5b1b0b623567c4f;hpb=06fbdc15c8db57590c9b6a38ee1f00d5f349cff9;p=alttp.git diff --git a/app/Models/TwitchBotCommand.php b/app/Models/TwitchBotCommand.php index 716b8d5..e232bdf 100644 --- a/app/Models/TwitchBotCommand.php +++ b/app/Models/TwitchBotCommand.php @@ -11,6 +11,18 @@ class TwitchBotCommand extends Model { use HasFactory; + public static function adlibChat(Channel $channel, User $user = null) { + $cmd = new TwitchBotCommand(); + $cmd->command = 'adlib-chat'; + $cmd->parameters = [ + 'channel' => $channel->id, + ]; + $cmd->status = 'pending'; + $cmd->user()->associate($user); + $cmd->bot_nick = 'horstiebot'; + $cmd->save(); + } + public static function chat($channel, $text, User $user = null, $nick = 'localhorsttv') { $cmd = new TwitchBotCommand(); $cmd->command = 'chat'; @@ -48,6 +60,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); }