catch promise

This commit is contained in:
Erik 2022-07-17 12:31:12 +03:00
parent 1a5f8d9276
commit 28266403f6
Signed by: Navy.gif
GPG Key ID: 811EC0CD80E7E5FB

View File

@ -68,7 +68,7 @@ class PollCommand extends SlashCommand {
time: 90, editReply: true
});
if (!response || !response.content) return invoker.editReply({ index: 'COMMAND_POLL_TIMEOUT' });
if(invoker.channel.permissionsFor(guild.me).has('MANAGE_MESSAGES')) await response.delete();
if(invoker.channel.permissionsFor(guild.me).has('MANAGE_MESSAGES')) await response.delete().catch(() => null);
const { content } = response;
if (content.toLowerCase() === 'stop') break;
if (content.toLowerCase() === 'cancel') return invoker.editReply({ index: 'GENERAL_CANCELLED' });