JaBa/commands/Moderation/clear-sanctions.js

30 lines
883 B
JavaScript
Raw Normal View History

2021-12-10 21:39:54 +05:00
const Command = require("../../base/Command.js");
class Clearsanctions extends Command {
constructor (client) {
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 13:43:01 +05:00
aliases: [ "clearwarns" ],
2021-12-10 21:39:54 +05:00
memberPermissions: [ "MANAGE_MESSAGES" ],
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ],
nsfw: false,
ownerOnly: false,
cooldown: 2000
2021-12-10 21:39:54 +05:00
});
}
async run (message, args) {
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-10 21:39:54 +05:00
const memberData = await this.client.findOrCreateMember({ id: member.id, guildID: message.guild.id });
memberData.sanctions = [];
memberData.save();
2021-12-11 01:11:50 +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;