Fix category field being empty crashing the bot

This commit is contained in:
Vylpes 2020-11-08 17:49:41 +00:00
parent 96dba8c84b
commit b519537072
3 changed files with 3 additions and 121 deletions

View file

@ -38,6 +38,9 @@ class util {
// Get the roles required for this command to run
let requiredRoles = command.roles;
// Get the category, if there is no category, set it to a default string
if (!command.category) command.category = "none";
// Loop through all roles required
for (let i = 0; i < requiredRoles.length; i++) {
// If the user doesn't have a required role, don't run the command and let the user know