nyx/command/Owner/blacklist.js

44 lines
1.1 KiB
JavaScript
Raw Normal View History

2021-09-21 01:51:56 +02:00
module.exports = {
name: "blacklist",
category: "Owner",
usage: "(User) (Toggle) (Reason)",
description: "Blacklist someone from the bot",
Owner: true,
options: [
{
type: 6,
name: "user",
description: "The user to blacklist/whitelist",
required: true,
},
{
type: 5,
name: "yesno",
description: "Whether blacklist or whitelist",
required: true,
},
{
type: 3,
name: "reason",
description: "The reason to blacklist",
required: true,
},
],
run: async (client, interaction, args) => {
let user = interaction.options.getUser("user");
toggle = interaction.options.getBoolean("yesno");
reason = interaction.options.getString("reason");
if (toggle === true) {
await client.data.BK(user.id, toggle, reason);
interaction.followUp({
content: `**Blacklisted** ${user.username}.\n**Reason: **${reason}`,
});
} else {
await client.data.BK(user.id, toggle, reason);
interaction.followUp({
content: `Removed blacklist from ${user.username}`,
});
}
},
};