From 128a018df4aa26378f7cfd90556ce51d7d96bf62 Mon Sep 17 00:00:00 2001 From: JonnyBro Date: Sat, 5 Feb 2022 22:16:07 +0500 Subject: [PATCH] =?UTF-8?q?=D0=9C=D0=B5=D0=BB=D0=BA=D0=B8=D0=B5=20=D0=BF?= =?UTF-8?q?=D1=80=D0=B0=D0=B2=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- events/guildCreate.js | 5 ++++- events/guildDelete.js | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/events/guildCreate.js b/events/guildCreate.js index 8d9b8e59..34d15087 100644 --- a/events/guildCreate.js +++ b/events/guildCreate.js @@ -38,6 +38,9 @@ module.exports = class { const owner = await guild.fetchOwner(); owner.send(messageOptions); + const users = guild.members.cache.filter((m) => !m.user.bot).size; + const bots = guild.members.cache.filter((m) => m.user.bot).size; + const embed = new Discord.MessageEmbed() .setAuthor({ name: guild.name, @@ -46,7 +49,7 @@ module.exports = class { }) }) .setColor("#32CD32") - .setDescription(`Зашёл на сервер **${guild.name}**. На нём **${guild.members.cache.filter((m) => !m.user.bot).size}** пользователей (из них ${guild.members.cache.filter((m) => m.user.bot).size} ботов)`); + .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"))})`); this.client.channels.cache.get(this.client.config.support.logs).send({ embeds: [embed] }); diff --git a/events/guildDelete.js b/events/guildDelete.js index 053fa58c..5cc81f17 100644 --- a/events/guildDelete.js +++ b/events/guildDelete.js @@ -6,6 +6,9 @@ module.exports = class { } async run(guild) { + const users = guild.members.cache.filter((m) => !m.user.bot).size; + const bots = guild.members.cache.filter((m) => m.user.bot).size; + const embed = new Discord.MessageEmbed() .setAuthor({ name: guild.name, @@ -14,7 +17,7 @@ module.exports = class { }) }) .setColor("#B22222") - .setDescription(`Вышел с сервера **${guild.name}**. На нём **${guild.members.cache.filter((m) => !m.user.bot).size}** пользователей (из них ${guild.members.cache.filter((m) => m.user.bot).size} ботов)`); + .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"))})`); this.client.channels.cache.get(this.client.config.support.logs).send({ embeds: [embed] });