]> git.localhorst.tv Git - alttp.git/blobdiff - app/Console/Commands/TwitchBotCommand.php
twitch bot dummy
[alttp.git] / app / Console / Commands / TwitchBotCommand.php
diff --git a/app/Console/Commands/TwitchBotCommand.php b/app/Console/Commands/TwitchBotCommand.php
new file mode 100644 (file)
index 0000000..55ae34b
--- /dev/null
@@ -0,0 +1,43 @@
+<?php
+
+namespace App\Console\Commands;
+
+use App\TwitchBot\TwitchBot;
+use Illuminate\Console\Command;
+
+class TwitchBotCommand extends Command {
+
+       /**
+        * The name and signature of the console command.
+        *
+        * @var string
+        */
+       protected $signature = 'twitch:bot';
+
+       /**
+        * The console command description.
+        *
+        * @var string
+        */
+       protected $description = 'Runs the twitch bot';
+
+       /**
+        * Execute the console command.
+        *
+        * @return int
+        */
+       public function handle() {
+               $bot = new TwitchBot();
+
+               $bot->getLoop()->addSignal(SIGINT, function() use ($bot) {
+                       $bot->stop();
+               });
+
+               $bot->run();
+
+               return 0;
+       }
+
+}
+
+?>