use client.exists
This commit is contained in:
1 parent
1cbe4356bc
commit
9edb6b98d7
4 files changed
+7
-12
No files matched your search
@@ -25,7 +25,7 @@ module.exports = {
|
|||||||
if (channel.type=="voice") return message.channel.send(`Connot set voice channel to preferred channel.`);
|
if (channel.type=="voice") return message.channel.send(`Connot set voice channel to preferred channel.`);
|
||||||
if (channel.deleted) return message.channel.send(`Connot set deleted channel to preferred channel.`);
|
if (channel.deleted) return message.channel.send(`Connot set deleted channel to preferred channel.`);
|
||||||
let guild = await client.dbo.collection("prefixes").findOne({"server.serverID":message.guild.id}).then(guild => guild);
|
let guild = await client.dbo.collection("prefixes").findOne({"server.serverID":message.guild.id}).then(guild => guild);
|
||||||
if (exists(guild.server.allowedChannels)&&guild.server.allowedChannels.includes(channelid)) return message.channel.send(`The channel ${args[0]} has already been added.`);
|
if (client.exists(guild.server.allowedChannels)&&guild.server.allowedChannels.includes(channelid)) return message.channel.send(`The channel ${args[0]} has already been added.`);
|
||||||
client.dbo.collection("prefixes").updateOne({"server.serverID":message.guild.id},{$push:{"server.allowedChannels":channelid},$set:{"server.hasCustomChannels":true}},function(err, res) {
|
client.dbo.collection("prefixes").updateOne({"server.serverID":message.guild.id},{$push:{"server.allowedChannels":channelid},$set:{"server.hasCustomChannels":true}},function(err, res) {
|
||||||
if (err) throw err;
|
if (err) throw err;
|
||||||
return message.channel.send(`Successfully added ${args[0]} to allowed channels.`);
|
return message.channel.send(`Successfully added ${args[0]} to allowed channels.`);
|
||||||
|
|||||||
+1
-2
@@ -1,5 +1,4 @@
|
|||||||
const { MessageEmbed } = require('discord.js');
|
const { MessageEmbed } = require('discord.js');
|
||||||
const exists = require('../util/Exists')
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: "setrole",
|
name: "setrole",
|
||||||
@@ -25,7 +24,7 @@ module.exports = {
|
|||||||
return message.channel.send(`Uh Oh! The role ${args[0]} connot be found.`);
|
return message.channel.send(`Uh Oh! The role ${args[0]} connot be found.`);
|
||||||
} else {
|
} else {
|
||||||
let guild = await client.dbo.collection("prefixes").findOne({"server.serverID":message.guild.id}).then(guild => guild);
|
let guild = await client.dbo.collection("prefixes").findOne({"server.serverID":message.guild.id}).then(guild => guild);
|
||||||
if (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) {
|
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;
|
if (err) throw err;
|
||||||
return message.channel.send(`Successfully added ${args[0]} to allowed roles.`);
|
return message.channel.send(`Successfully added ${args[0]} to allowed roles.`);
|
||||||
|
|||||||
+5
-5
@@ -2,11 +2,11 @@ module.exports = async (client) => {
|
|||||||
(client.Ready = true),
|
(client.Ready = true),
|
||||||
client.user.setPresence({
|
client.user.setPresence({
|
||||||
status: client.config.Presence.status, // You can show online, idle, and dnd
|
status: client.config.Presence.status, // You can show online, idle, and dnd
|
||||||
activity: {
|
activity: {
|
||||||
name: client.config.Presence.name,
|
name: client.config.Presence.name,
|
||||||
type: client.config.Presence.type,
|
type: client.config.Presence.type,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
client.log("Successfully Logged in as " + client.user.tag); // You can change the text if you want, but DO NOT REMOVE "client.user.tag"
|
client.log("Successfully Logged in as " + client.user.tag); // You can change the text if you want, but DO NOT REMOVE "client.user.tag"
|
||||||
client.RegisterSlashCommands();
|
client.RegisterSlashCommands();
|
||||||
};
|
};
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
module.exports = n => {
|
|
||||||
if (n == null || n == undefined || n == "") return false;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
Reference in new issue
Block a user