JaBa/events/Guild/guildBanAdd.js

34 lines
663 B
JavaScript
Raw Normal View History

const BaseEvent = require("../../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],
});
} catch (e) { /**/ }
}
}
2023-07-05 00:58:06 +05:00
module.exports = guildBanAdd;