]> git.localhorst.tv Git - alttp.git/blob - app/Console/Commands/TwitchBotCommand.php
twitch bot dummy
[alttp.git] / app / Console / Commands / TwitchBotCommand.php
1 <?php
2
3 namespace App\Console\Commands;
4
5 use App\TwitchBot\TwitchBot;
6 use Illuminate\Console\Command;
7
8 class TwitchBotCommand extends Command {
9
10         /**
11          * The name and signature of the console command.
12          *
13          * @var string
14          */
15         protected $signature = 'twitch:bot';
16
17         /**
18          * The console command description.
19          *
20          * @var string
21          */
22         protected $description = 'Runs the twitch bot';
23
24         /**
25          * Execute the console command.
26          *
27          * @return int
28          */
29         public function handle() {
30                 $bot = new TwitchBot();
31
32                 $bot->getLoop()->addSignal(SIGINT, function() use ($bot) {
33                         $bot->stop();
34                 });
35
36                 $bot->run();
37
38                 return 0;
39         }
40
41 }
42
43 ?>