mirror of
https://github.com/JonnyBro/JaBa.git
synced 2025-01-04 09:43:03 +05:00
37 lines
819 B
JavaScript
37 lines
819 B
JavaScript
import BaseEvent from "../../base/BaseEvent";
|
|
|
|
class GuildDelete extends BaseEvent {
|
|
constructor() {
|
|
super({
|
|
name: "guildDelete",
|
|
once: false,
|
|
});
|
|
}
|
|
|
|
/**
|
|
*
|
|
* @param {import("../../base/Client")} client
|
|
* @param {import("discord.js").Guild} guild
|
|
*/
|
|
async execute(client, guild) {
|
|
if (client.config.support.logs) {
|
|
const embed = client.embed({
|
|
author: {
|
|
name: guild.name,
|
|
iconURL: guild.iconURL() || client.user.avatarURL(),
|
|
},
|
|
description: `Left from guild **${guild.name}**.`,
|
|
});
|
|
|
|
const logChannel = client.channels.cache.get(client.config.support.logs);
|
|
|
|
if (logChannel) {
|
|
await logChannel.send({
|
|
embeds: [embed],
|
|
});
|
|
} else client.logger.warn(`Log channel not found for guild deletion: ${guild.name}`);
|
|
}
|
|
}
|
|
}
|
|
|
|
export default GuildDelete;
|