From c126f6b034774a6b61c240ab38b6c7d577807a2c Mon Sep 17 00:00:00 2001 From: JonnyBro Date: Thu, 4 Aug 2022 21:02:45 +0500 Subject: [PATCH] =?UTF-8?q?=D0=A4=D0=B8=D0=BA=D1=81=D0=B8=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- events/CommandHandler.js | 2 +- events/MessageHandler.js | 6 +++--- events/ready.js | 18 +++++++++--------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/events/CommandHandler.js b/events/CommandHandler.js index e60466f6..b785210a 100644 --- a/events/CommandHandler.js +++ b/events/CommandHandler.js @@ -1,5 +1,5 @@ -const BaseEvent = require("../base/BaseEvent"); const { InteractionType } = require("discord.js"); +const BaseEvent = require("../base/BaseEvent"); class CommandHandler extends BaseEvent { constructor() { diff --git a/events/MessageHandler.js b/events/MessageHandler.js index 2d800d17..8daf7904 100644 --- a/events/MessageHandler.js +++ b/events/MessageHandler.js @@ -1,6 +1,6 @@ -const { PermissionsBitField } = require("discord.js"), - xpCooldown = {}, - BaseEvent = require("../base/BaseEvent"); +const { PermissionsBitField } = require("discord.js"); +const BaseEvent = require("../base/BaseEvent"), + xpCooldown = {}; class MessageCreate extends BaseEvent { constructor() { diff --git a/events/ready.js b/events/ready.js index 1ec9e54b..4cbf5c4e 100644 --- a/events/ready.js +++ b/events/ready.js @@ -1,5 +1,5 @@ -const BaseEvent = require("../base/BaseEvent"), - { PermissionsBitField } = require("discord.js"); +const { PermissionsBitField, ActivityType } = require("discord.js"); +const BaseEvent = require("../base/BaseEvent"); class Ready extends BaseEvent { constructor() { @@ -45,10 +45,10 @@ class Ready extends BaseEvent { // Update status const version = require("../package.json").version; const status = [ - { name: "help", type: "LISTENING" }, - { name: `${commands.length} ${client.getNoun(commands.length, client.translate("misc:NOUNS:COMMANDS:1"), client.translate("misc:NOUNS:COMMANDS:2"), client.translate("misc:NOUNS:COMMANDS:5"))}`, type: "LISTENING"}, - { name: `${tServers} ${client.getNoun(tServers, client.translate("misc:NOUNS:SERVER:1"), client.translate("misc:NOUNS:SERVER:2"), client.translate("misc:NOUNS:SERVER:5"))}`, type: "WATCHING" }, - { name: `${tUsers} ${client.getNoun(tUsers, client.translate("misc:NOUNS:USERS:1"), client.translate("misc:NOUNS:USERS:2"), client.translate("misc:NOUNS:USERS:5"))}`, type: "WATCHING" } + { name: "help", type: ActivityType.Watching }, + { name: `${commands.length} ${client.getNoun(commands.length, client.translate("misc:NOUNS:COMMANDS:1"), client.translate("misc:NOUNS:COMMANDS:2"), client.translate("misc:NOUNS:COMMANDS:5"))}`, type: ActivityType.Listening }, + { name: `${tServers} ${client.getNoun(tServers, client.translate("misc:NOUNS:SERVER:1"), client.translate("misc:NOUNS:SERVER:2"), client.translate("misc:NOUNS:SERVER:5"))}`, type: ActivityType.Watching }, + { name: `${tUsers} ${client.getNoun(tUsers, client.translate("misc:NOUNS:USERS:1"), client.translate("misc:NOUNS:USERS:2"), client.translate("misc:NOUNS:USERS:5"))}`, type: ActivityType.Watching } ]; let i = 0; @@ -56,15 +56,15 @@ class Ready extends BaseEvent { hiddenGuild = await client.guilds.fetch("568120814776614924"); tUsers = client.users.cache.size - hiddenGuild.memberCount; tServers = client.guilds.cache.size - 1; - const toShow = status[parseInt(i, 10)]; + const toShow = status[i]; client.user.setActivity(`${toShow.name} | v${version}`, { type: toShow.type }); - if (status[parseInt(i + 1, 10)]) i++; + if (status[i + 1]) i++; else i = 0; - }, 10 * 1000); // Every 10 seconds + }, 10000); // Every 10 seconds } }