]> git.localhorst.tv Git - alttp.git/blob - app/TwitchBot/RunnerCommand.php
better yes classification
[alttp.git] / app / TwitchBot / RunnerCommand.php
1 <?php
2
3 namespace App\TwitchBot;
4
5 class RunnerCommand extends ChatCommand {
6
7         public function execute($args) {
8                 $episode = $this->channel->getCurrentEpisode();
9                 if (!$episode) return;
10                 $links = [];
11                 foreach ($episode->players as $player) {
12                         $link = $player->getStreamLink();
13                         if (empty($link)) {
14                                 $link = $player->getName();
15                         }
16                         if (!empty($link)) {
17                                 $links[] = $link;
18                         }
19                 }
20                 $message = 'Runner: '.implode(' ', $links);
21                 $this->messageChannel($message);
22         }
23
24 }
25
26 ?>