Skip to content

Commit

Permalink
Update guildDelete.js
Browse files Browse the repository at this point in the history
  • Loading branch information
appujet authored Sep 25, 2021
1 parent 5c297d6 commit 6679f1a
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions events/Client/guildDelete.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
const { MessageEmbed } = require('discord.js');
const config = require('../../config.json');
const moment = require('moment');

module.exports = async (client, guild) => {
client.users.fetch("491577179495333903").then(user => {
user.send(`🔔 Leaved: ${guild.name} (${guild.id}) - ${guild.members.cache.size} members`);
})
}

const channel = client.channels.cache.get(config.logs);
let own = await guild.fetchOwner()

const embed = new MessageEmbed()
.setThumbnail(guild.iconURL({ dynamic: true, size: 1024}))
.setTitle(`📤 Left a Guild !!`)
.addField('Name', `\`${guild.name}\``)
.addField('ID', `\`${guild.id}\``)
.addField('Owner', `\`${guild.members.cache.get(own.id) ? guild.members.cache.get(own.id).user.tag : "Unknown user"}\` ${own.id}\``)
.addField('Member Count', `\`${guild.memberCount}\` Members`)
.addField('Creation Date', `\`${moment.utc(guild.createdAt).format('DD/MMM/YYYY')}\``)
.addField(`${client.user.username}'s Server Count`, `\`${client.guilds.cache.size}\` Severs`)
.setColor(client.embedColor)
.setTimestamp()
channel.send({embeds: [embed]})
}

0 comments on commit 6679f1a

Please sign in to comment.