Fix bug which wouldn't let anyone to run a command

This commit is contained in:
vylpes 2020-11-01 11:09:20 +00:00
parent 45cd269248
commit c1786d1f18

View file

@ -50,11 +50,13 @@ class util {
// Get the ids of the users that are only permitted to run this command // Get the ids of the users that are only permitted to run this command
let users = command.users; let users = command.users;
// If the user isn't in the list, don't run the command // If the command has any limits, limit the command, otherwise default to anyone
if (users.length > 0) {
if (!users.includes(message.member.id)) { if (!users.includes(message.member.id)) {
message.reply(`You do not have permission to run this command`); message.reply(`You do not have permission to run this command`);
return; return;
} }
}
// Run the command and pass the command context with it // Run the command and pass the command context with it
command[command.run]({ command[command.run]({