JaBa/events/Guild/guildBanAdd.js
2024-12-05 20:15:07 +05:00

35 lines
657 B
JavaScript

import BaseEvent from "../../base/BaseEvent";
class guildBanAdd extends BaseEvent {
constructor() {
super({
name: "guildBanAdd",
once: false,
});
}
/**
*
* @param {import("../../base/Client")} client
* @param {import("discord.js").GuildBan} ban
*/
async execute(client, ban) {
const embed = client.embed({
author: {
name: client.user.getUsername(),
iconURL: ban.guild.iconURL(),
},
description: `You were banned from **${ban.guild.name}**!\nReason: **${ban.reason || "Not specified"}**`,
});
try {
await ban.user.send({
embeds: [embed],
});
} catch {
/**/
}
}
}
export default guildBanAdd;