2023-03-26 18:31:19 +05:00
|
|
|
const { EmbedBuilder } = require("discord.js"),
|
|
|
|
BaseEvent = require("../../base/BaseEvent");
|
|
|
|
|
|
|
|
class guildBanAdd extends BaseEvent {
|
|
|
|
constructor() {
|
|
|
|
super({
|
|
|
|
name: "guildBanAdd",
|
|
|
|
once: false,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @param {import("../../base/JaBa")} client
|
|
|
|
* @param {import("discord.js").GuildBan} ban
|
|
|
|
*/
|
|
|
|
async execute(client, ban) {
|
|
|
|
const embed = new EmbedBuilder()
|
|
|
|
.setAuthor({
|
2023-07-03 19:30:47 +05:00
|
|
|
name: client.user.getUsername(),
|
2023-03-26 18:31:19 +05:00
|
|
|
iconURL: ban.guild.iconURL(),
|
|
|
|
})
|
2023-07-03 19:30:47 +05:00
|
|
|
.setColor(client.config.embed.color)
|
|
|
|
.setFooter({ text: client.config.embed.footer })
|
|
|
|
.setDescription(`You were banned from **${ban.guild.name}**!\nReason: **${ban.reason || "Not specified"}**`);
|
2023-03-26 18:31:19 +05:00
|
|
|
|
|
|
|
ban.user.send({
|
|
|
|
embeds: [embed],
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = guildBanAdd;
|