X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=app%2FModels%2FTwitchBotCommand.php;fp=app%2FModels%2FTwitchBotCommand.php;h=14cabf7a9513d0f812d317710b457652d397ac77;hb=51a752c7cce2465043dfb3d63a0152b64765b167;hp=94462e4e5798b6d7967052b2d3054a59b77f722b;hpb=4b0f87a8b0683579c53c68f35b18e5d08c30b3b9;p=alttp.git diff --git a/app/Models/TwitchBotCommand.php b/app/Models/TwitchBotCommand.php index 94462e4..14cabf7 100644 --- a/app/Models/TwitchBotCommand.php +++ b/app/Models/TwitchBotCommand.php @@ -11,6 +11,18 @@ class TwitchBotCommand extends Model { use HasFactory; + public static function chat($channel, $text, User $user = null) { + $cmd = new TwitchBotCommand(); + $cmd->command = 'chat'; + $cmd->parameters = [ + 'channel' => $channel, + 'text' => $text, + ]; + $cmd->status = 'pending'; + $cmd->user()->associate($user); + $cmd->save(); + } + public static function join($channel, User $user = null) { $cmd = new TwitchBotCommand(); $cmd->command = 'join';