JaBa/commands/Moderation/clear-sanctions.js

30 lines
870 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, {
name: "clear-sanctions",
dirname: __dirname,
enabled: true,
guildOnly: true,
aliases: [],
memberPermissions: [ "MANAGE_MESSAGES" ],
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ],
nsfw: false,
ownerOnly: false,
cooldown: 3000
});
}
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;