mirror of
https://github.com/musix-org/musix-oss
synced 2025-07-07 04:20:49 +00:00
Update V3.2.0
This commit is contained in:
109
src/commands/settings/blacklist.ts
Normal file
109
src/commands/settings/blacklist.ts
Normal file
@ -0,0 +1,109 @@
|
||||
const discord = require("discord.js");
|
||||
|
||||
module.exports = {
|
||||
name: "blacklist",
|
||||
async execute(msg, args, client) {
|
||||
if (args[2] === "add") {
|
||||
if (msg.mentions.channels.first()) {
|
||||
if (
|
||||
client.global.db.guilds[msg.guild.id].blacklist.includes(
|
||||
msg.mentions.channels.first().id
|
||||
)
|
||||
)
|
||||
return msg.channel.send(client.messages.channelAlreadyBlackListed);
|
||||
} else if (
|
||||
client.global.db.guilds[msg.guild.id].blacklist.includes(args[3])
|
||||
)
|
||||
return msg.channel.send(client.messages.channelAlreadyBlackListed);
|
||||
if (
|
||||
!msg.guild.channels.cache.get(args[3]) &&
|
||||
!msg.mentions.channels.first()
|
||||
)
|
||||
return msg.channel.send(client.messages.idOrMentionChannel);
|
||||
if (msg.mentions.channels.first()) {
|
||||
client.global.db.guilds[msg.guild.id].blacklist.push(
|
||||
msg.mentions.channels.first().id
|
||||
);
|
||||
let message;
|
||||
message = client.messages.channelAdded.replace(
|
||||
"%CHANNEL%",
|
||||
msg.mentions.channels.first().name
|
||||
);
|
||||
msg.channel.send(message);
|
||||
} else {
|
||||
client.global.db.guilds[msg.guild.id].blacklist.push(args[3]);
|
||||
let message;
|
||||
message = client.messages.channelAdded.replace(
|
||||
"%CHANNEL%",
|
||||
msg.guild.channels.cache.get(args[3]).name
|
||||
);
|
||||
msg.channel.send(message);
|
||||
}
|
||||
} else if (args[2] === "remove") {
|
||||
if (msg.mentions.channels.first()) {
|
||||
if (
|
||||
!client.global.db.guilds[msg.guild.id].blacklist.includes(
|
||||
msg.mentions.channels.first().id
|
||||
)
|
||||
)
|
||||
return msg.channel.send(client.messages.channelNotBlackListed);
|
||||
if (
|
||||
client.global.db.guilds[msg.guild.id].blacklist.indexOf(
|
||||
msg.mentions.channels.first().id
|
||||
) !== -1
|
||||
) {
|
||||
client.global.db.guilds[msg.guild.id].blacklist.splice(
|
||||
client.global.db.guilds[msg.guild.id].blacklist.indexOf(
|
||||
msg.mentions.channels.first().id
|
||||
),
|
||||
1
|
||||
);
|
||||
let message;
|
||||
message = client.messages.channelRemoved.replace(
|
||||
"%CHANNEL%",
|
||||
msg.mentions.channels.first().name
|
||||
);
|
||||
}
|
||||
} else {
|
||||
if (!client.global.db.guilds[msg.guild.id].blacklist.includes(args[3]))
|
||||
return msg.channel.send(client.messages.channelNotBlackListed);
|
||||
if (
|
||||
client.global.db.guilds[msg.guild.id].blacklist.indexOf(args[3]) !==
|
||||
-1
|
||||
) {
|
||||
client.global.db.guilds[msg.guild.id].blacklist.splice(
|
||||
client.global.db.guilds[msg.guild.id].blacklist.indexOf(args[3]),
|
||||
1
|
||||
);
|
||||
let message;
|
||||
message = client.messages.channelRemoved.replace(
|
||||
"%CHANNEL%",
|
||||
msg.guild.channels.cache.get(args[3]).name
|
||||
);
|
||||
msg.channel.send(message);
|
||||
}
|
||||
}
|
||||
} else if (args[2] === "list") {
|
||||
const embed = new discord.MessageEmbed()
|
||||
.setTitle(client.messages.blacklistTitle)
|
||||
.setDescription(
|
||||
`${client.global.db.guilds[msg.guild.id].blacklist
|
||||
.map((c) => `**-** <#${c}>`)
|
||||
.join("\n")}`
|
||||
)
|
||||
.setColor(client.config.embedColor);
|
||||
msg.channel.send(embed);
|
||||
} else {
|
||||
const embed = new discord.MessageEmbed()
|
||||
.setTitle(client.messages.blacklistTitle)
|
||||
.addField("add", "Add a channel to the blacklist. (ID or mention)")
|
||||
.addField(
|
||||
"remove",
|
||||
"Remove a channel from the blacklist. (ID or mention)"
|
||||
)
|
||||
.addField("list", "List the currently blacklisted channels.")
|
||||
.setColor(client.config.embedColor);
|
||||
msg.channel.send(embed);
|
||||
}
|
||||
},
|
||||
};
|
28
src/commands/settings/premium.ts
Normal file
28
src/commands/settings/premium.ts
Normal file
@ -0,0 +1,28 @@
|
||||
module.exports = {
|
||||
name: "premium",
|
||||
async execute(msg, args, client) {
|
||||
if (msg.member.id !== client.config.devId)
|
||||
return msg.channel.send(client.messages.onlyDev);
|
||||
if (!args[2])
|
||||
return msg.channel.send(
|
||||
`${client.messages.correctUsage} ${client.messages.premiumUsage}`
|
||||
);
|
||||
if (client.global.db.guilds[args[2]].premium === false) {
|
||||
client.global.db.guilds[args[2]].premium = true;
|
||||
let message;
|
||||
message = client.messages.nowPremium.replace(
|
||||
"%GUILD%",
|
||||
client.guilds.cache.get(args[2]).name
|
||||
);
|
||||
msg.channel.send(message);
|
||||
} else if (client.global.db.guilds[args[2]].premium === true) {
|
||||
client.global.db.guilds[args[2]].premium = false;
|
||||
let message;
|
||||
message = client.messages.noMorePremium.replace(
|
||||
"%GUILD%",
|
||||
client.guilds.cache.get(args[2]).name
|
||||
);
|
||||
msg.channel.send(message);
|
||||
}
|
||||
},
|
||||
};
|
Reference in New Issue
Block a user