Skip to content

Commit a4e944b

Browse files
committed
Mapswap role ping
1 parent 8a41f4c commit a4e944b

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

bot.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@
177177
'blue' => '1132678353070067802', // Blugoslavia
178178
'organizer' => '1089060051425165362', // Admin / Faction Organizer
179179
// Notification pings
180+
'mapswap' => '1200520534262284288', // Map Swap Ping
180181
'round_start' => '1110597830403424328', // Round Start Ping
181182
'2+' => '981963719804346418', // LowPopStart
182183
'15+' => '981963721817620511', // 15+ Popping

civ13.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,11 @@ protected function generateServerFunctions(): void
423423
$split_message = explode("{$settings['key']}mapswap ", $message_filtered['message_content']);
424424
if (count($split_message) < 2 || !($mapto = strtoupper($split_message[1]))) return $this->reply($message, 'You need to include the name of the map.');
425425
$this->OOCMessage("Server is now changing map to `$mapto`.", $this->getVerifiedItem($message->author)['ss13'] ?? $this->discord->user->displayname, $settings);
426+
if (isset($settings['discussion']) && $channel = $this->discord->getChannel($settings['discussion'])) {
427+
$msg = "Server is now changing map to `$mapto`.";
428+
if (isset($this->role_ids['mapswap']) && $role = $this->role_ids['mapswap']); $msg = "<@&$role>, $msg";
429+
$channel->sendMessage($msg);
430+
}
426431
$this->loop->addtimer(10, function () use ($mapto, $mapswap, $message): ?PromiseInterface
427432
{
428433
if ($message) $message->react("👍");

0 commit comments

Comments
 (0)