if ($mtime < $crew->updated_at) {
$mtime = $crew->updated_at;
}
+ if ($crew->user && $mtime < $crew->user->updated_at) {
+ $mtime = $crew->user->updated_at;
+ }
}
foreach ($episode->players as $player) {
if ($mtime < $player->updated_at) {
$mtime = $player->updated_at;
+ if ($player->user && $mtime < $player->user->updated_at) {
+ $mtime = $crew->user->updated_at;
+ }
}
}
$memo = $this->getMemo($guild, $episode);
if (is_null($memo->synced_at) || $memo->synced_at < $mtime) {
+ $this->line('pushing '.$episode->id.' '.$episode->getScheduledEventName());
DiscordBotCommand::episodeEvent($guild, $episode);
}
}
if ($this->title != '') {
$parts[] = $this->title;
}
- if ($this->event->title != '') {
+ if ($this->event->title != '' && strlen(implode(' - ', $parts).' - '.$this->event->title) < 100) {
$parts[] = $this->event->title;
}
- return implode(' - ', $parts);
+ $name = implode(' - ', $parts);
+ return $name;
}
public function getScheduledEventDescription(): string {
if ($this->comment != '') {
$description .= $this->comment."\n";
}
+ if (count($this->players)) {
+ $description .= "\nPlayers:\n";
+ foreach ($this->players as $player) {
+ $link = $player->getStreamLink();
+ if ($link) {
+ $description .= '- ['.$player->getName().']('.$link.")\n";
+ } else {
+ $description .= '- '.$player->getName()."\n";
+ }
+ }
+ }
return $description;
}