nyx/command/Owner/blacklist.js

60 lines
1.9 KiB
JavaScript
Raw Permalink Normal View History

2021-09-21 01:51:56 +02:00
module.exports = {
name: "blacklist",
category: "Owner",
usage: "(User) (Toggle) (Reason)",
2021-12-24 08:45:42 +01:00
description: "Manage Blacklisted Users",
2021-09-21 01:51:56 +02:00
Owner: true,
options: [
{
type: 6,
name: "user",
description: "The user to blacklist/whitelist",
required: true,
},
{
type: 5,
2021-12-24 08:45:42 +01:00
name: "blacklist",
description: "Whether to blacklist or whitelist",
2021-09-21 01:51:56 +02:00
required: true,
},
{
type: 3,
name: "reason",
description: "The reason to blacklist",
required: true,
},
],
run: async (client, interaction) => {
2021-12-09 20:42:55 +01:00
const user = interaction.options.getUser("user");
2021-12-24 08:45:42 +01:00
const toggle = interaction.options.getBoolean("blacklist");
2021-12-09 20:42:55 +01:00
const reason = interaction.options.getString("reason");
2021-09-21 01:51:56 +02:00
if (toggle === true) {
await client.data.BK(user.id, toggle, reason);
const embed = new MessageEmbed()
.setTitle(
"<a:nyx_checkmark:897240322411724841> Successfully Blacklisted"
)
.setDescription(
`**User:** ${user.user.tag} \`(${user.id})\`\n**Reason:** ${reason} \n**Blacklisted by:** ${interaction.member}`
)
.setURL(client.web)
.setColor(client.color)
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
.setTimestamp();
interaction.followUp({ embeds: [embed] });
2021-09-21 01:51:56 +02:00
} else {
await client.data.BK(user.id, toggle, reason);
const embed = new MessageEmbed()
.setTitle("<a:nyx_checkmark:897240322411724841> Removed From Blacklist")
.setDescription(
`**User:** ${user.user.tag} \`(${user.id})\`\n**Reason:** ${reason} \n**Whitelisted by:** ${interaction.member}`
)
.setURL(client.web)
.setColor(client.color)
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
.setTimestamp();
interaction.followUp({ embeds: [embed] });
2021-09-21 01:51:56 +02:00
}
},
};