2024-02-06 21:45:53 +05:00
|
|
|
const BaseEvent = require("../../base/BaseEvent");
|
2023-03-26 18:31:19 +05:00
|
|
|
|
|
|
|
class guildBanAdd extends BaseEvent {
|
|
|
|
constructor() {
|
|
|
|
super({
|
|
|
|
name: "guildBanAdd",
|
|
|
|
once: false,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
2023-11-05 16:03:23 +05:00
|
|
|
* @param {import("../../base/Client")} client
|
2023-03-26 18:31:19 +05:00
|
|
|
* @param {import("discord.js").GuildBan} ban
|
|
|
|
*/
|
|
|
|
async execute(client, ban) {
|
2024-02-06 21:45:53 +05:00
|
|
|
const embed = client.embed({
|
|
|
|
author: {
|
2023-07-03 19:30:47 +05:00
|
|
|
name: client.user.getUsername(),
|
2023-03-26 18:31:19 +05:00
|
|
|
iconURL: ban.guild.iconURL(),
|
2024-02-06 21:45:53 +05:00
|
|
|
},
|
|
|
|
description: `You were banned from **${ban.guild.name}**!\nReason: **${ban.reason || "Not specified"}**`,
|
2023-03-26 18:31:19 +05:00
|
|
|
});
|
2024-02-06 21:45:53 +05:00
|
|
|
|
|
|
|
try {
|
|
|
|
ban.user.send({
|
|
|
|
embeds: [embed],
|
|
|
|
});
|
|
|
|
} catch (e) { /**/ }
|
2023-03-26 18:31:19 +05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-07-05 00:58:06 +05:00
|
|
|
module.exports = guildBanAdd;
|