mirror of
https://github.com/JonnyBro/JaBa.git
synced 2024-11-25 22:55:00 +05:00
Мелкие правки в эвенте ready
This commit is contained in:
parent
e5ae4d0e47
commit
ca2e3930cc
2 changed files with 18 additions and 11 deletions
|
@ -7,9 +7,9 @@ module.exports = class {
|
||||||
|
|
||||||
async run() {
|
async run() {
|
||||||
const client = this.client;
|
const client = this.client;
|
||||||
const hiddenGuild = await client.guilds.fetch("568120814776614924");
|
let hiddenGuild = await client.guilds.fetch("568120814776614924");
|
||||||
const tUsers = client.users.cache.size - hiddenGuild.memberCount;
|
let tUsers = client.users.cache.size - hiddenGuild.memberCount;
|
||||||
const tServers = client.guilds.cache.size - 1;
|
let tServers = client.guilds.cache.size - 1;
|
||||||
|
|
||||||
// Logs some informations using logger
|
// Logs some informations using logger
|
||||||
client.logger.log(`Loading a total of ${client.commands.size} command(s).`, "log");
|
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");
|
const discordbotsorg = require("../helpers/discordbots.org");
|
||||||
discordbotsorg.init(client);
|
discordbotsorg.init(client);
|
||||||
|
|
||||||
// UNMUTE USERS
|
// Unmute users
|
||||||
const checkUnmutes = require("../helpers/checkUnmutes");
|
const checkUnmutes = require("../helpers/checkUnmutes");
|
||||||
checkUnmutes.init(client);
|
checkUnmutes.init(client);
|
||||||
|
|
||||||
// SEND REMINDS
|
// Send reminds
|
||||||
const checkReminds = require("../helpers/checkReminds");
|
const checkReminds = require("../helpers/checkReminds");
|
||||||
checkReminds.init(client);
|
checkReminds.init(client);
|
||||||
|
|
||||||
// Start the dashboard
|
// Start the dashboard
|
||||||
if (client.config.dashboard.enabled) client.dashboard.load(client);
|
if (client.config.dashboard.enabled) client.dashboard.load(client);
|
||||||
|
|
||||||
// Update status every 20s
|
// Update status
|
||||||
let servers = client.guilds.cache.filter(guild => guild.id !== "568120814776614924" && guild.id !== "892727526911258654").size;
|
|
||||||
const version = require("../package.json").version;
|
const version = require("../package.json").version;
|
||||||
const status = [
|
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: "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;
|
let i = 0;
|
||||||
setInterval(function () {
|
setInterval(async function () {
|
||||||
servers = client.guilds.cache.filter(guild => guild.id !== "568120814776614924" && guild.id !== "892727526911258654").size;
|
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)];
|
const toShow = status[parseInt(i, 10)];
|
||||||
|
|
||||||
client.user.setActivity(`${toShow.name} | v${version}`, {
|
client.user.setActivity(`${toShow.name} | v${version}`, {
|
||||||
|
|
|
@ -55,6 +55,11 @@
|
||||||
"2": "участника",
|
"2": "участника",
|
||||||
"5": "участников"
|
"5": "участников"
|
||||||
},
|
},
|
||||||
|
"USERS": {
|
||||||
|
"1": "пользователь",
|
||||||
|
"2": "пользователя",
|
||||||
|
"5": "пользователей"
|
||||||
|
},
|
||||||
"BOTS": {
|
"BOTS": {
|
||||||
"1": "бот",
|
"1": "бот",
|
||||||
"2": "бота",
|
"2": "бота",
|
||||||
|
|
Loading…
Reference in a new issue