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' };