--- /dev/null
+<?php
+
+namespace App\TwitchBot;
+
+class CrewCommand extends ChatCommand {
+
+ public function execute($args) {
+ $episode = $this->channel->getCurrentEpisode();
+ if (!$episode) return;
+ $links = [];
+ foreach ($episode->crew as $crew) {
+ $link = $crew->getStreamLink();
+ if (empty($link)) {
+ $link = $crew->getName();
+ }
+ if (!empty($link)) {
+ if (!isset($links[$crew->role])) {
+ $links[$crew->role] = [];
+ }
+ $links[$crew->role][] = $link;
+ }
+ }
+ $parts = [];
+ if (!empty($links['commentary']) && $this->getBooleanConfig('commentary', true)) {
+ $parts[] = 'Kommentar: '.implode(' ', $links['commentary']);
+ }
+ if (!empty($links['tracking']) && $this->getBooleanConfig('tracking', true)) {
+ $parts[] = 'Tracking: '.implode(' ', $links['tracking']);
+ }
+ if (!empty($links['setup']) && $this->getBooleanConfig('setup', false)) {
+ $parts[] = 'Setup: '.implode(' ', $links['setup']);
+ }
+ if (!empty($parts)) {
+ $message = implode(' ', $parts);
+ $this->messageChannel($message);
+ }
+ }
+
+}
+
+?>