nyx/command/Owner/blacklist.js

66 lines
2 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)",
2022-01-15 22:35:02 +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,
2022-01-15 22:35:02 +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) => {
const user = interaction.options.getUser("user");
2022-01-15 22:35:02 +01:00
const toggle = interaction.options.getBoolean("blacklist");
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);
2022-10-26 12:38:28 +02:00
const embed = new EmbedBuilder()
2022-01-15 22:35:02 +01:00
.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)
2022-10-26 12:38:28 +02:00
.setFooter({
text: `Made by ${client.author}`,
2023-04-02 14:12:53 +02:00
iconURL: client.user.displayAvatarURL({ dynamic: true }),
2022-10-26 12:38:28 +02:00
})
2022-01-15 22:35:02 +01:00
.setTimestamp();
interaction.followUp({ embeds: [embed] });
2021-09-21 01:51:56 +02:00
} else {
await client.data.BK(user.id, toggle, reason);
2022-10-26 12:38:28 +02:00
const embed = new EmbedBuilder()
2022-01-15 22:35:02 +01:00
.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)
2022-10-26 12:38:28 +02:00
.setFooter({
text: `Made by ${client.author}`,
2023-04-02 14:12:53 +02:00
iconURL: client.user.displayAvatarURL({ dynamic: true }),
2022-10-26 12:38:28 +02:00
})
2022-01-15 22:35:02 +01:00
.setTimestamp();
interaction.followUp({ embeds: [embed] });
2021-09-21 01:51:56 +02:00
}
},
};