JaBa/events/Guild/guildBanAdd.js

36 lines
657 B
JavaScript
Raw Normal View History

2024-12-05 20:15:07 +05:00
import BaseEvent from "../../base/BaseEvent";
class guildBanAdd extends BaseEvent {
constructor() {
super({
name: "guildBanAdd",
once: false,
});
}
/**
*
2023-11-05 16:03:23 +05:00
* @param {import("../../base/Client")} client
* @param {import("discord.js").GuildBan} ban
*/
async execute(client, ban) {
const embed = client.embed({
author: {
2023-07-03 19:30:47 +05:00
name: client.user.getUsername(),
iconURL: ban.guild.iconURL(),
},
description: `You were banned from **${ban.guild.name}**!\nReason: **${ban.reason || "Not specified"}**`,
});
try {
2024-10-03 11:07:02 +05:00
await ban.user.send({
embeds: [embed],
});
2024-12-05 20:15:07 +05:00
} catch {
/**/
}
}
}
2024-12-05 20:15:07 +05:00
export default guildBanAdd;