]> git.localhorst.tv Git - alttp.git/blob - app/Console/Commands/TwitchChatBotCommand.php
sync ladder schedule
[alttp.git] / app / Console / Commands / TwitchChatBotCommand.php
1 <?php
2
3 namespace App\Console\Commands;
4
5 use App\TwitchBot\TwitchChatBot;
6 use Illuminate\Console\Command;
7
8 class TwitchChatBotCommand extends Command {
9
10         /**
11          * The name and signature of the console command.
12          *
13          * @var string
14          */
15         protected $signature = 'twitch:chatbot';
16
17         /**
18          * The console command description.
19          *
20          * @var string
21          */
22         protected $description = 'Runs the chat twitch bot';
23
24         /**
25          * Execute the console command.
26          *
27          * @return int
28          */
29         public function handle() {
30                 $bot = new TwitchChatBot();
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 ?>