mirror of
https://github.com/JonnyBro/JaBa.git
synced 2024-11-22 05:04:58 +05:00
Склонения и 12 часов в work
This commit is contained in:
parent
3c3802c293
commit
563c668562
3 changed files with 15 additions and 4 deletions
|
@ -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");
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
};
|
Loading…
Reference in a new issue