From ca2e3930cccccf25d79089304e89af2b99b45738 Mon Sep 17 00:00:00 2001 From: JonnyBro Date: Mon, 24 Jan 2022 02:06:30 +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=20=D0=B2=20=D1=8D=D0=B2=D0=B5?= =?UTF-8?q?=D0=BD=D1=82=D0=B5=20ready?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- events/ready.js | 24 +++++++++++++----------- languages/ru-RU/misc.json | 5 +++++ 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/events/ready.js b/events/ready.js index f4130e44..00a6d71e 100644 --- a/events/ready.js +++ b/events/ready.js @@ -7,9 +7,9 @@ module.exports = class { async run() { const client = this.client; - const hiddenGuild = await client.guilds.fetch("568120814776614924"); - const tUsers = client.users.cache.size - hiddenGuild.memberCount; - const tServers = client.guilds.cache.size - 1; + let hiddenGuild = await client.guilds.fetch("568120814776614924"); + let tUsers = client.users.cache.size - hiddenGuild.memberCount; + let tServers = client.guilds.cache.size - 1; // Logs some informations using logger client.logger.log(`Loading a total of ${client.commands.size} command(s).`, "log"); @@ -28,29 +28,31 @@ module.exports = class { const discordbotsorg = require("../helpers/discordbots.org"); discordbotsorg.init(client); - // UNMUTE USERS + // Unmute users const checkUnmutes = require("../helpers/checkUnmutes"); checkUnmutes.init(client); - // SEND REMINDS + // Send reminds const checkReminds = require("../helpers/checkReminds"); checkReminds.init(client); // Start the dashboard if (client.config.dashboard.enabled) client.dashboard.load(client); - // Update status every 20s - let servers = client.guilds.cache.filter(guild => guild.id !== "568120814776614924" && guild.id !== "892727526911258654").size; + // Update status const version = require("../package.json").version; const status = [ - { name: `${servers} ${client.getNoun(servers, client.translate("misc:NOUNS:SERVER:1"), client.translate("misc:NOUNS:SERVER:2"), client.translate("misc:NOUNS:SERVER:5"))}`, type: "LISTENING" }, { name: "help", type: "WATCHING" }, - { name: `${client.commands.size} ${client.getNoun(servers, client.translate("misc:NOUNS:COMMANDS:1"), client.translate("misc:NOUNS:COMMANDS:2"), client.translate("misc:NOUNS:COMMANDS:5"))}`, type: "WATCHING"} + { name: `${client.commands.size} ${client.getNoun(client.commands.size, client.translate("misc:NOUNS:COMMANDS:1"), client.translate("misc:NOUNS:COMMANDS:2"), client.translate("misc:NOUNS:COMMANDS:5"))}`, type: "WATCHING"}, + { name: `${tServers} ${client.getNoun(tServers, client.translate("misc:NOUNS:SERVER:1"), client.translate("misc:NOUNS:SERVER:2"), client.translate("misc:NOUNS:SERVER:5"))}`, type: "LISTENING" }, + { name: `${tUsers} ${client.getNoun(tUsers, client.translate("misc:NOUNS:USERS:1"), client.translate("misc:NOUNS:USERS:2"), client.translate("misc:NOUNS:USERS:5"))}`, type: "LISTENING" } ]; let i = 0; - setInterval(function () { - servers = client.guilds.cache.filter(guild => guild.id !== "568120814776614924" && guild.id !== "892727526911258654").size; + setInterval(async function () { + hiddenGuild = await client.guilds.fetch("568120814776614924"); + tUsers = client.users.cache.size - hiddenGuild.memberCount; + tServers = client.guilds.cache.filter(guild => guild.id !== "568120814776614924" && guild.id !== "892727526911258654").size; const toShow = status[parseInt(i, 10)]; client.user.setActivity(`${toShow.name} | v${version}`, { diff --git a/languages/ru-RU/misc.json b/languages/ru-RU/misc.json index b562947d..c8f4997f 100644 --- a/languages/ru-RU/misc.json +++ b/languages/ru-RU/misc.json @@ -55,6 +55,11 @@ "2": "участника", "5": "участников" }, + "USERS": { + "1": "пользователь", + "2": "пользователя", + "5": "пользователей" + }, "BOTS": { "1": "бот", "2": "бота",