]> git.localhorst.tv Git - alttp.git/blobdiff - app/TwitchBotCommands/JoinCommand.php
basic twitch join/part commands
[alttp.git] / app / TwitchBotCommands / JoinCommand.php
diff --git a/app/TwitchBotCommands/JoinCommand.php b/app/TwitchBotCommands/JoinCommand.php
new file mode 100644 (file)
index 0000000..38b6e1e
--- /dev/null
@@ -0,0 +1,23 @@
+<?php
+
+namespace App\TwitchBotCommands;
+
+use App\Models\TwitchBotCommand;
+use App\TwitchBot\IRCMessage;
+use App\TwitchBot\TwitchBot;
+use React\Promise\Promise;
+
+class JoinCommand extends BaseCommand {
+
+       public function __construct(TwitchBot $bot, TwitchBotCommand $cmd) {
+               parent::__construct($bot, $cmd);
+       }
+
+       public function execute() {
+               return new Promise(function($resolve) {
+                       $this->bot->sendIRCMessage(IRCMessage::join([$this->getParameter('channel')]));
+                       $resolve();
+               });
+       }
+
+}