Skip to content

Commit

Permalink
feat: directly inform user about missing View Channel permission
Browse files Browse the repository at this point in the history
  • Loading branch information
zapteryx committed Oct 27, 2022
1 parent a677719 commit 251a5f3
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/events/interactionCreate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
{
Expand Down

0 comments on commit 251a5f3

Please sign in to comment.