diff --git a/commands/Economy/work.js b/commands/Economy/work.js index 24b58668..23ceaa0f 100644 --- a/commands/Economy/work.js +++ b/commands/Economy/work.js @@ -30,7 +30,7 @@ class Work extends Command { if (Date.now() > data.memberData.cooldowns.work + (24 * 3600000)) data.memberData.workStreak = 0; // Records in the database the time when the member will be able to execute the command again (in 12 hours) - const toWait = Date.now() + 21600000; + const toWait = Date.now() + 43200000; data.memberData.cooldowns.work = toWait; data.memberData.markModified("cooldowns"); diff --git a/events/ready.js b/events/ready.js index ec779464..cd014ee1 100644 --- a/events/ready.js +++ b/events/ready.js @@ -38,7 +38,7 @@ module.exports = class { // Update status every 20s let servers = client.guilds.cache.filter(guild => guild.id != "568120814776614924" && guild.id != "892727526911258654").size; const status = [ - { name: `${servers} ${getNoun(`${servers}`, "сервер", "сервера", "серверов")}`, type: "WATCHING" }, + { name: `${servers} ${getNoun(servers, "сервер", "сервера", "серверов")}`, type: "WATCHING" }, { name: "help", type: "WATCHING" } ]; const version = require("../package.json").version; diff --git a/helpers/autoUpdateDocs.js b/helpers/autoUpdateDocs.js index 946e706b..6f593b24 100644 --- a/helpers/autoUpdateDocs.js +++ b/helpers/autoUpdateDocs.js @@ -24,7 +24,7 @@ module.exports = { [ "Название", "Описание", "Использование", "Откат" ] ]; const cmds = commands.filter((cmd) => cmd.help.category === cat).array(); - text += `### ${cat} (${cmds.length} команд(а/ы))\n\n`; + text += `### ${cat} (${cmds.length} ${getNoun(cmds.length, "команда", "команды", "команд")}команд(а/ы))\n\n`; cmds.sort(function(a, b) { if (a.help.name < b.help.name) return -1; else return 1; @@ -33,7 +33,7 @@ module.exports = { `**${cmd.help.name}** ${cmd.help.aliases.length ? `**(${cmd.help.aliases.join(", ")})**` : ""}`, client.translate(`${cmd.help.category.toLowerCase()}/${cmd.help.name}:DESCRIPTION`), client.translate(`${cmd.help.category.toLowerCase()}/${cmd.help.name}:USAGE`), - Math.ceil(cmd.conf.cooldown / 1000)+" секунд(а/ы)" + `${Math.ceil(cmd.conf.cooldown / 1000)} ${getNoun(cmds.length, "секунда", "секунды", "секунд")}` ]); }); text += `${table(arrCat)}\n\n`; @@ -57,4 +57,15 @@ module.exports = { client.logger.log("Docs updated!"); }; } +}; + +function getNoun(number, one, two, five) { + let n = Math.abs(number); + n %= 100; + if (n >= 5 && n <= 20) return five; + n %= 10; + if (n === 1) return one; + if (n >= 2 && n <= 4) return two; + + return five; }; \ No newline at end of file