3 namespace App\TwitchBot;
5 class CrewCommand extends ChatCommand {
7 public function execute($args) {
8 $episode = $this->channel->getCurrentEpisode();
11 foreach ($episode->confirmedCrewOfChannel($this->channel)->get() as $crew) {
12 $link = $crew->getStreamLink();
14 $link = $crew->getName();
17 if (!isset($links[$crew->role])) {
18 $links[$crew->role] = [];
20 $links[$crew->role][] = $link;
24 if (!empty($links['commentary']) && $this->getBooleanConfig('commentary', true)) {
25 $parts[] = 'Kommentar: '.implode(' ', $links['commentary']);
27 if (!empty($links['tracking']) && $this->getBooleanConfig('tracking', true)) {
28 $parts[] = 'Tracking: '.implode(' ', $links['tracking']);
30 if (!empty($links['setup']) && $this->getBooleanConfig('setup', false)) {
31 $parts[] = 'Setup: '.implode(' ', $links['setup']);
34 $message = implode(' ', $parts);
35 $this->messageChannel($message);