nyx/unused/commands/Config/rr-rmv.js

35 lines
1.1 KiB
JavaScript
Raw Normal View History

2021-06-12 12:53:51 +02:00
const Schema = require("../../models/reaction");
module.exports = {
name: "rr-rmv",
UserPerm: "ADMINISTRATOR",
description: "Remove reaction role for server",
category: "Config",
run: async (client, message, args, utils) => {
2021-06-12 12:53:51 +02:00
message.channel
.send({ content: "**Do you want to remove the reaction roles?**" })
2021-06-12 12:53:51 +02:00
.then(async msg => {
Schema.findOne({ Guild: message.guild.id }, async (err, data) => {
if (err) throw err;
if (!data) return client.err(message, "Config", "rr-rmv", 10);
});
const emoji = await utils.confirmation(
2021-06-12 12:53:51 +02:00
msg,
message.author,
["✅", "❌"],
10000
);
if (emoji === "✅") {
msg.delete();
await Schema.findOneAndDelete({ Guild: message.guild.id });
message.channel.send({
content: `Removed reaction roles for this server.`,
});
2021-06-12 12:53:51 +02:00
}
if (emoji === "❌") {
msg.delete();
message.channel.send({ content: "Cancelled." });
2021-06-12 12:53:51 +02:00
}
});
},
};