2022-01-04 02:18:28 +05:00
|
|
|
const Command = require("../../base/Command.js");
|
|
|
|
|
2022-01-05 22:04:46 +05:00
|
|
|
class Clearwarns extends Command {
|
2022-01-04 02:18:28 +05:00
|
|
|
constructor(client) {
|
|
|
|
super(client, {
|
2022-01-05 22:04:46 +05:00
|
|
|
name: "clearwarns",
|
2022-01-04 02:18:28 +05:00
|
|
|
dirname: __dirname,
|
|
|
|
enabled: true,
|
|
|
|
guildOnly: true,
|
2022-01-05 22:04:46 +05:00
|
|
|
aliases: ["clearw", "clw"],
|
2022-01-04 02:18:28 +05:00
|
|
|
memberPermissions: ["MANAGE_MESSAGES"],
|
|
|
|
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
|
|
|
|
nsfw: false,
|
|
|
|
ownerOnly: false,
|
|
|
|
cooldown: 1000
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
async run(message, args) {
|
|
|
|
const member = await this.client.resolveMember(args[0], message.guild);
|
2022-01-05 22:04:46 +05:00
|
|
|
if (!member) return message.error("moderation/clearwarns:MISSING_MEMBER");
|
2022-01-04 02:18:28 +05:00
|
|
|
|
|
|
|
const memberData = await this.client.findOrCreateMember({
|
|
|
|
id: member.id,
|
|
|
|
guildID: message.guild.id
|
|
|
|
});
|
|
|
|
memberData.sanctions = [];
|
|
|
|
memberData.save();
|
2022-01-05 22:04:46 +05:00
|
|
|
message.success("moderation/clearwarns:SUCCESS", {
|
2022-01-04 02:18:28 +05:00
|
|
|
username: member.user.tag
|
|
|
|
});
|
|
|
|
}
|
2022-01-13 00:26:23 +05:00
|
|
|
}
|
2022-01-04 02:18:28 +05:00
|
|
|
|
2022-01-05 22:04:46 +05:00
|
|
|
module.exports = Clearwarns;
|