2021-06-12 12:53:51 +02:00
|
|
|
const { Client, Message, MessageEmbed } = require("discord.js");
|
|
|
|
module.exports = {
|
|
|
|
name: "unban",
|
|
|
|
description: "Unban an user",
|
|
|
|
UserPerm: "BAN_MEMBERS",
|
|
|
|
BotPerm: "BAN_MEMBERS",
|
|
|
|
usage: "(User)",
|
|
|
|
category: "Moderation",
|
|
|
|
run: async (client, message, args) => {
|
|
|
|
try {
|
|
|
|
if (!args[0]) return client.err(message, "Moderation", "unban", 1);
|
|
|
|
const user = await message.guild.members.unban(args[0]);
|
|
|
|
const embed = new MessageEmbed()
|
|
|
|
.setTitle("User Unbanned")
|
|
|
|
.addField("**Moderator**", message.author.tag, true)
|
2021-06-12 18:53:58 +02:00
|
|
|
.addField("**User**", user.tag, true)
|
2021-06-12 12:53:51 +02:00
|
|
|
.setFooter(
|
|
|
|
message.member.displayName || message.author.username,
|
|
|
|
message.author.displayAvatarURL({ dynamic: true })
|
|
|
|
)
|
|
|
|
.setThumbnail(client.user.displayAvatarURL())
|
|
|
|
.setColor(client.color)
|
|
|
|
.setTimestamp();
|
|
|
|
message.inlineReply(embed);
|
|
|
|
} catch (e) {
|
|
|
|
console.log(e);
|
|
|
|
return client.err(message, "Moderation", "unban", 999);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
};
|