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