From 5f310e94942c7afdc89c980017b0e78da8baf5bf Mon Sep 17 00:00:00 2001 From: "Navy.gif" Date: Thu, 1 Sep 2022 20:32:29 +0300 Subject: [PATCH] hnng --- src/localization/en_gb/commands/en_gb_utility.lang | 3 +++ src/structure/components/commands/utility/Poll.js | 1 + 2 files changed, 4 insertions(+) diff --git a/src/localization/en_gb/commands/en_gb_utility.lang b/src/localization/en_gb/commands/en_gb_utility.lang index ac398d4..af6974c 100644 --- a/src/localization/en_gb/commands/en_gb_utility.lang +++ b/src/localization/en_gb/commands/en_gb_utility.lang @@ -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. diff --git a/src/structure/components/commands/utility/Poll.js b/src/structure/components/commands/utility/Poll.js index 1bd64ca..5f64e9f 100644 --- a/src/structure/components/commands/utility/Poll.js +++ b/src/structure/components/commands/utility/Poll.js @@ -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' };