JaBa/events/guildDelete.js

25 lines
996 B
JavaScript
Raw Normal View History

2022-01-04 02:18:28 +05:00
const Discord = require("discord.js");
module.exports = class {
constructor(client) {
this.client = client;
}
async run(guild) {
2022-02-05 22:16:07 +05:00
const users = guild.members.cache.filter((m) => !m.user.bot).size;
const bots = guild.members.cache.filter((m) => m.user.bot).size;
2022-01-04 02:18:28 +05:00
const embed = new Discord.MessageEmbed()
.setAuthor({
name: guild.name,
iconURL: guild.iconURL({
dynamic: true
})
})
2022-01-04 02:18:28 +05:00
.setColor("#B22222")
2022-02-05 22:20:38 +05:00
.setDescription(`Вышел с сервера **${guild.name}**. На нём **${users}** ${this.client.getNoun(users, this.client.translate("misc:NOUNS:MEMBERS:1"), this.client.translate("misc:NOUNS:MEMBERS:2"), this.client.translate("misc:NOUNS:MEMBERS:5"))} (из них **${bots}** ${this.client.getNoun(bots, this.client.translate("misc:NOUNS:BOTS:1"), this.client.translate("misc:NOUNS:BOTS:2"), this.client.translate("misc:NOUNS:BOTS:5"))})`);
2022-01-16 20:59:08 +05:00
this.client.channels.cache.get(this.client.config.support.logs).send({
embeds: [embed]
});
2022-01-04 02:18:28 +05:00
}
};