From 251a5f3c8f11d14a538a2f49a8513ccf9a3dc611 Mon Sep 17 00:00:00 2001 From: Max Date: Thu, 27 Oct 2022 19:28:22 +0800 Subject: [PATCH] feat: directly inform user about missing View Channel permission --- src/events/interactionCreate.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/events/interactionCreate.ts b/src/events/interactionCreate.ts index 252f383b..06dda594 100644 --- a/src/events/interactionCreate.ts +++ b/src/events/interactionCreate.ts @@ -154,6 +154,16 @@ export default { } bot permission check(s)`, label: 'Warden', }); + if ( + failedPermissions.bot.includes('ViewChannel') || + failedPermissions.bot.includes('SendMessages') + ) { + await interaction.replyHandler.locale( + 'DISCORD.INSUFFICIENT_PERMISSIONS.BOT.VIEW', + { type: 'error' }, + ); + return; + } await interaction.replyHandler.locale( 'DISCORD.INSUFFICIENT_PERMISSIONS.BOT.DEFAULT', {