Skip to content

Commit 91198c9

Browse files
committed
Add Discord ID support for rank app command
1 parent 8a7fcd0 commit 91198c9

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

slash.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -728,6 +728,9 @@ public function declareListeners(): void
728728
$this->civ13->discord->listenCommand('rank', function (Interaction $interaction) use ($rankme): PromiseInterface
729729
{ //TODO
730730
if (! $ckey = $interaction->data->options['ckey']->value ?? $this->civ13->verified->get('discord', $interaction->member->id)['ss13'] ?? null) return $interaction->respondWithMessage(MessageBuilder::new()->setContent("<@{$interaction->member->id}> is not currently verified with a byond username or it does not exist in the cache yet"), true);
731+
if (is_numeric($ckey = $this->civ13->sanitizeInput($ckey)))
732+
if (! $ckey = $this->civ13->verified->get('discord', $ckey)['ss13'])
733+
return $interaction->respondWithMessage(MessageBuilder::new()->setContent("The Discord ID `$ckey` is not currently verified with a Byond username or it does not exist in the cache yet"), true);
731734
$server = $interaction->data->options['server']->value;
732735
if ($ranking = $rankme($this->civ13->server_settings[$server]['basedir'] . Civ13::ranking_path, $ckey)) return $interaction->respondWithMessage(MessageBuilder::new()->setContent($ranking), true);
733736
return $interaction->respondWithMessage(MessageBuilder::new()->setContent("`$ckey` is not currently ranked on the `$server` server."), true);

0 commit comments

Comments
 (0)