Just like the permissions field for command configuration, there will be another field:
{
name: 'help',
aliases: ['h', 'help!'],
permissions: ['SEND_MESSAGES'],
access: {
roles: ['ROLE ID'],
users: ['USER ID'],
permissions: ['SEND_MESSAGES'], // Any user with the SEND_MESSAGES permission will be able to use this command
}
}
The bot will also throw an InvalidUserAccess error, which the user will be able to catch using:
try {
...
} catch(err) {
if (err instanceof InvalidUserAccess) {
...
}
}