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": "бота",