JaBa/events/guildDelete.js

23 lines
No EOL
697 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

const Discord = require("discord.js");
module.exports = class {
constructor(client) {
this.client = client;
}
async run(guild) {
const text = `Вышел с сервера **${guild.name}**. На нём **${guild.members.cache.filter((m) => !m.user.bot).size}** пользователей (из них ${guild.members.cache.filter((m) => m.user.bot).size} ботов)`;
// Sends log embed in the logs channel
const embed = new Discord.MessageEmbed()
.setAuthor({
name: guild.name,
iconURL: guild.iconURL({
dynamic: true
})
})
.setColor("#B22222")
.setDescription(text);
this.client.channels.cache.get(this.client.config.support.logs).send(embed);
}
};