+ 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();
+ }
+