2021-12-10 21:39:54 +05:00
|
|
|
const Command = require("../../base/Command.js");
|
|
|
|
|
|
|
|
class Clearsanctions extends Command {
|
2021-12-26 19:29:37 +05:00
|
|
|
constructor(client) {
|
2021-12-10 21:39:54 +05:00
|
|
|
super(client, {
|
2021-12-26 13:43:01 +05:00
|
|
|
name: "clearsanctions",
|
2021-12-10 21:39:54 +05:00
|
|
|
dirname: __dirname,
|
|
|
|
enabled: true,
|
|
|
|
guildOnly: true,
|
2021-12-26 19:29:37 +05:00
|
|
|
aliases: ["clearwarns"],
|
|
|
|
memberPermissions: ["MANAGE_MESSAGES"],
|
|
|
|
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
|
2021-12-10 21:39:54 +05:00
|
|
|
nsfw: false,
|
|
|
|
ownerOnly: false,
|
2021-12-22 17:32:50 +05:00
|
|
|
cooldown: 2000
|
2021-12-10 21:39:54 +05:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2021-12-26 19:29:37 +05:00
|
|
|
async run(message, args) {
|
2021-12-10 21:39:54 +05:00
|
|
|
const member = await this.client.resolveMember(args[0], message.guild);
|
2021-12-11 01:11:50 +05:00
|
|
|
if (!member) return message.error("moderation/clear-sanctions:MISSING_MEMBER");
|
|
|
|
|
2021-12-26 19:29:37 +05:00
|
|
|
const memberData = await this.client.findOrCreateMember({
|
|
|
|
id: member.id,
|
|
|
|
guildID: message.guild.id
|
|
|
|
});
|
2021-12-10 21:39:54 +05:00
|
|
|
memberData.sanctions = [];
|
|
|
|
memberData.save();
|
2021-12-26 19:29:37 +05:00
|
|
|
message.success("moderation/clear-sanctions:SUCCESS", {
|
|
|
|
username: member.user.tag
|
|
|
|
});
|
2021-12-10 21:39:54 +05:00
|
|
|
}
|
2021-12-11 01:11:50 +05:00
|
|
|
};
|
2021-12-10 21:39:54 +05:00
|
|
|
|
|
|
|
module.exports = Clearsanctions;
|