This commit is contained in:
Erik 2022-09-01 20:32:29 +03:00
parent f6e3f6c38d
commit 5f310e9494
Signed by untrusted user: Navy.gif
GPG Key ID: 811EC0CD80E7E5FB
2 changed files with 4 additions and 0 deletions

View File

@ -129,6 +129,9 @@ Successfully deleted the poll.
[COMMAND_POLL_ENDED]
Successfully ended the poll.
[COMMAND_POLL_MISSING_CHANNEL]
Failed to find the poll's channel.
// Grantable
[COMMAND_GRANTABLE_HELP]
Lists roles grantable with the `/roles add|remove` command.

View File

@ -120,6 +120,7 @@ class PollCommand extends SlashCommand {
if (!poll) return { index: 'COMMAND_POLL_404', emoji: 'failure' };
await guild.removeCallback(poll.id);
const pollChannel = await guild.resolveChannel(poll.channel);
if(!channel) return { index: 'COMMAND_POLL_MISSING_CHANNEL', emoji: 'failure' };
const msg = await pollChannel.messages.fetch(poll.message).catch(() => null);
if(msg) await msg.delete();
return { index: 'COMMAND_POLL_DELETED', emoji: 'success' };