Skip to content

Commit

Permalink
Possibly fixes #59
Browse files Browse the repository at this point in the history
  • Loading branch information
saiteja-madha committed Dec 7, 2021
1 parent c4f163a commit 290b72f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/events/guild/guildDelete.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ const { getSettings } = require("@schemas/Guild");
* @param {import('discord.js').Guild} guild
*/
module.exports = async (client, guild) => {
if (!guild.members.cache.has(guild.ownerId)) await guild.fetchOwner({ cache: true });
client.logger.log(`Guild Left: ${guild.name} Members: ${guild.memberCount}`);

const settings = await getSettings(guild);
Expand All @@ -15,13 +14,14 @@ module.exports = async (client, guild) => {

if (!client.joinLeaveWebhook) return;

const owner = await client.users.fetch(guild.ownerId);
const embed = new MessageEmbed()
.setTitle("Guild Left")
.setThumbnail(guild.iconURL())
.setColor(client.config.EMBED_COLORS.ERROR)
.addField("Name", guild.name, false)
.addField("ID", guild.id, false)
.addField("Owner", `${client.users.cache.get(guild.ownerId).tag} [\`${guild.ownerId}\`]`, false)
.addField("Owner", `${owner.username}#${owner.discriminator} [\`${owner.id}\`]`, false)
.addField("Members", `\`\`\`yaml\n${guild.memberCount}\`\`\``, false)
.setFooter(`Guild #${client.guilds.cache.size}`);

Expand Down

0 comments on commit 290b72f

Please sign in to comment.