From c1786d1f181df18690ad801fdd1ce1a2c7948113 Mon Sep 17 00:00:00 2001 From: vylpes Date: Sun, 1 Nov 2020 11:09:20 +0000 Subject: [PATCH] Fix bug which wouldn't let anyone to run a command --- src/client/util.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/client/util.js b/src/client/util.js index 67038bd..0b988a7 100644 --- a/src/client/util.js +++ b/src/client/util.js @@ -50,10 +50,12 @@ class util { // Get the ids of the users that are only permitted to run this command let users = command.users; - // If the user isn't in the list, don't run the command - if (!users.includes(message.member.id)) { - message.reply(`You do not have permission to run this command`); - return; + // If the command has any limits, limit the command, otherwise default to anyone + if (users.length > 0) { + if (!users.includes(message.member.id)) { + message.reply(`You do not have permission to run this command`); + return; + } } // Run the command and pass the command context with it