Skip to content

Commit

Permalink
Update MessageServiceManager.php
Browse files Browse the repository at this point in the history
  • Loading branch information
valzargaming committed Aug 4, 2024
1 parent 182f853 commit fd1ebda
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/Civ13/MessageServiceManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -760,14 +760,11 @@ function (Message $message, string $command, array $message_filtered): PromiseIn
: $this->civ13->reply($message, 'No data found.'),
['Ambassador'])
->offsetSet('playerlist',
function (Message $message, string $command, array $message_filtered): PromiseInterface
{ // This function is only authorized to be used by the database administrator
if ($message->user_id != $this->civ13->technician_id) return $message->react("");
$playerlist = [];
foreach ($this->civ13->enabled_gameservers as &$gameserver) $playerlist = array_unique(array_merge($playerlist, $gameserver->players));
if ($playerlist) return $this->civ13->reply($message, implode(', ', $playerlist));
return $this->civ13->reply($message, 'No players found.');
}, ['Chief Technical Officer'])
fn(Message $message, string $command, array $message_filtered): PromiseInterface => // This function is only authorized to be used by the database administrator
(($message->user_id === $this->civ13->technician_id) && $playerlist = array_unique(array_merge(...array_map(fn($gameserver) => $gameserver->players, $this->civ13->enabled_gameservers))))
? $this->civ13->reply($message, implode(', ', $playerlist))
: $message->react(""),
['Chief Technical Officer'])
->offsetSet('unvet',
function (Message $message, string $command, array $message_filtered): PromiseInterface
{ // Adds the infantry role to all veterans
Expand Down

0 comments on commit fd1ebda

Please sign in to comment.