handle undefined allowedRoles

This commit is contained in:
SowinskiBraeden committed 2024-01-23 22:29:22 -08:00
1 parent 4435f0b2df
commit 3355302994
3 files changed
+238 -1717

No files matched your search

+235 -1716
View File
File diff suppressed because it is too large. Load diff
+1 -1
View File
@@ -13,7 +13,7 @@
"dependencies": { "dependencies": {
"colors": "^1.4.0", "colors": "^1.4.0",
"discord-bitfield-calculator": "^1.2.0", "discord-bitfield-calculator": "^1.2.0",
"discord.js": "^14.3.0", "discord.js": "^14.8.0",
"dotenv": "^16.0.3", "dotenv": "^16.0.3",
"express": "^4.17.1", "express": "^4.17.1",
"moment-duration-format": "^2.3.2", "moment-duration-format": "^2.3.2",
+2
View File
@@ -214,6 +214,7 @@ class LinesPoliceCadBot extends Client {
}) })
}) })
}); });
// require('../util/RegisterSlashCommands')(this, "942619852567363674");
} }
async checkRoleStatus(rolesCache, allowedRoles) { async checkRoleStatus(rolesCache, allowedRoles) {
@@ -243,6 +244,7 @@ class LinesPoliceCadBot extends Client {
if (err) throw err; if (err) throw err;
}); });
} }
if (guild.server.allowedRoles == undefined) guild.server.allowedRoles = [];
let guildData = { let guildData = {
allowedChannels: guild.server.allowedChannels, allowedChannels: guild.server.allowedChannels,
customChannelStatus: guild.server.allowedChannels.length > 0 ? true : false, customChannelStatus: guild.server.allowedChannels.length > 0 ? true : false,