fix undefined exists func

This commit is contained in:
SowinskiBraeden committed 2022-05-06 13:42:50 -07:00
1 parent cd799a8974
commit 449131e990
3 files changed
+6 -6

No files matched your search

+1 -1
View File
@@ -24,7 +24,7 @@ module.exports = {
return message.channel.send(`Uh Oh! The role ${args[0]} connot be found.`);
} else {
let guild = await client.dbo.collection("prefixes").findOne({"server.serverID":message.guild.id}).then(guild => guild);
if (client.client.exists(guild.server.allowedRoles)&&guild.server.allowedRoles.includes(roleid)) return message.channel.send(`The role ${args[0]} has already been added.`);
if (client.exists(guild.server.allowedRoles)&&guild.server.allowedRoles.includes(roleid)) return message.channel.send(`The role ${args[0]} has already been added.`);
client.dbo.collection("prefixes").updateOne({"server.serverID":message.guild.id},{$push:{"server.allowedRoles":roleid},$set:{"server.hasCustomRoles":true}},function(err, res) {
if (err) throw err;
return message.channel.send(`Successfully added ${args[0]} to allowed roles.`);