]> git.localhorst.tv Git - alttp.git/blobdiff - app/TwitchBotCommands/ChatCommand.php
add twitch chat comand
[alttp.git] / app / TwitchBotCommands / ChatCommand.php
diff --git a/app/TwitchBotCommands/ChatCommand.php b/app/TwitchBotCommands/ChatCommand.php
new file mode 100644 (file)
index 0000000..fc69a01
--- /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 ChatCommand 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::privmsg($this->getParameter('channel'), $this->getParameter('text')));
+                       $resolve();
+               });
+       }
+
+}