CodecademyCommunity / codecademy-discord-bot

Custom moderation bot for the official Codecademy Community Discord server.
https://codecademycommunity.github.io/
MIT License
11 stars 1 forks source link

check slash cmd role perms in interaction handler #322

Closed mikejoh12 closed 2 years ago

mikejoh12 commented 2 years ago

What issue is this solving?

Closes #321

Description

Removes slash command permission setting by bulk update method as it's no longer supported by Discord in permissions v2. Moves role permission checks into a handler which checks permissions on interactionCreate event. Removes the default permissions false setting for the slash commands. Guild members will be able to launch all slash commands but a reply error message is presented for commands where the user does not have permission (similar to current text commands).

Any helpful knowledge/context for the reviewer?

Please make sure you've attempted to meet the following coding standards