Skip to content

Commit

Permalink
Mapswap role ping
Browse files Browse the repository at this point in the history
  • Loading branch information
valzargaming committed Jan 26, 2024
1 parent 8a41f4c commit a4e944b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions bot.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@
'blue' => '1132678353070067802', // Blugoslavia
'organizer' => '1089060051425165362', // Admin / Faction Organizer
// Notification pings
'mapswap' => '1200520534262284288', // Map Swap Ping
'round_start' => '1110597830403424328', // Round Start Ping
'2+' => '981963719804346418', // LowPopStart
'15+' => '981963721817620511', // 15+ Popping
Expand Down
5 changes: 5 additions & 0 deletions civ13.php
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,11 @@ protected function generateServerFunctions(): void
$split_message = explode("{$settings['key']}mapswap ", $message_filtered['message_content']);
if (count($split_message) < 2 || !($mapto = strtoupper($split_message[1]))) return $this->reply($message, 'You need to include the name of the map.');
$this->OOCMessage("Server is now changing map to `$mapto`.", $this->getVerifiedItem($message->author)['ss13'] ?? $this->discord->user->displayname, $settings);
if (isset($settings['discussion']) && $channel = $this->discord->getChannel($settings['discussion'])) {
$msg = "Server is now changing map to `$mapto`.";
if (isset($this->role_ids['mapswap']) && $role = $this->role_ids['mapswap']); $msg = "<@&$role>, $msg";
$channel->sendMessage($msg);
}
$this->loop->addtimer(10, function () use ($mapto, $mapswap, $message): ?PromiseInterface
{
if ($message) $message->react("👍");
Expand Down

0 comments on commit a4e944b

Please sign in to comment.