1
0
mirror of https://github.com/musix-org/musix-oss synced 2024-12-23 00:23:17 +00:00

Update blacklist.js

This commit is contained in:
MatteZ02 2020-06-29 20:48:44 +03:00
parent 83b56b73a0
commit 0e25ac5752

View File

@ -3,7 +3,9 @@ const discord = require("discord.js");
module.exports = {
name: "blacklist",
async execute(msg, args, client) {
if (args[2] === "add") {
let embed;
switch (args[2]) {
case "add":
if (msg.mentions.channels.first()) {
if (
client.global.db.guilds[msg.guild.id].blacklist.includes(
@ -39,7 +41,8 @@ module.exports = {
);
msg.channel.send(message);
}
} else if (args[2] === "remove") {
break;
case "remove":
if (msg.mentions.channels.first()) {
if (
!client.global.db.guilds[msg.guild.id].blacklist.includes(
@ -63,6 +66,7 @@ module.exports = {
"%CHANNEL%",
msg.mentions.channels.first().name
);
msg.channel.send(message);
}
} else {
if (!client.global.db.guilds[msg.guild.id].blacklist.includes(args[3]))
@ -83,8 +87,9 @@ module.exports = {
msg.channel.send(message);
}
}
} else if (args[2] === "list") {
const embed = new discord.MessageEmbed()
break;
case "list":
embed = new discord.MessageEmbed()
.setTitle(client.messages.blacklistTitle)
.setDescription(
`${client.global.db.guilds[msg.guild.id].blacklist
@ -93,8 +98,9 @@ module.exports = {
)
.setColor(client.config.embedColor);
msg.channel.send(embed);
} else {
const embed = new discord.MessageEmbed()
break;
case undefined:
embed = new discord.MessageEmbed()
.setTitle(client.messages.blacklistTitle)
.addField("add", "Add a channel to the blacklist. (ID or mention)")
.addField(
@ -104,6 +110,7 @@ module.exports = {
.addField("list", "List the currently blacklisted channels.")
.setColor(client.config.embedColor);
msg.channel.send(embed);
break;
}
},
};