Discord user and bot permission check options
BIRD-UP73 opened this issue · 1 comments
BIRD-UP73 commented
I added the following options to ICommand
userPerms?: PermissionResolvable,
botPerms?: PermissionResolvable
Now u can add Discord permissions a user needs to run a command. For example, in the avatar command
export const command: ICommand = {
name: 'avatar',
description: 'Shows the avatar of a user',
aliases: ['av', 'avi', 'pfp', 'pic', 'icon', 'usericon', 'img', 'ava'],
userPerms: ['SEND_MESSAGES'],
botPerms: ['SEND_MESSAGES'],
In app.ts this check is done for both the bot and the user that tries to invoke the command.
U won't need 'SEND_MESSAGES'
because u already check for that, but this can be done with any permissions.
kira0x1 commented
This is a great idea!