Merge pull request #6 from JonnyBro/appcommands

This commit is contained in:
Jonny_Bro (Жоня) 2022-08-04 21:04:08 +05:00 committed by GitHub
commit d178907eb2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 13 deletions

View file

@ -1,5 +1,5 @@
const BaseEvent = require("../base/BaseEvent");
const { InteractionType } = require("discord.js"); const { InteractionType } = require("discord.js");
const BaseEvent = require("../base/BaseEvent");
class CommandHandler extends BaseEvent { class CommandHandler extends BaseEvent {
constructor() { constructor() {

View file

@ -1,6 +1,6 @@
const { PermissionsBitField } = require("discord.js"), const { PermissionsBitField } = require("discord.js");
xpCooldown = {}, const BaseEvent = require("../base/BaseEvent"),
BaseEvent = require("../base/BaseEvent"); xpCooldown = {};
class MessageCreate extends BaseEvent { class MessageCreate extends BaseEvent {
constructor() { constructor() {

View file

@ -1,5 +1,5 @@
const BaseEvent = require("../base/BaseEvent"), const { PermissionsBitField, ActivityType } = require("discord.js");
{ PermissionsBitField } = require("discord.js"); const BaseEvent = require("../base/BaseEvent");
class Ready extends BaseEvent { class Ready extends BaseEvent {
constructor() { constructor() {
@ -45,10 +45,10 @@ class Ready extends BaseEvent {
// Update status // Update status
const version = require("../package.json").version; const version = require("../package.json").version;
const status = [ const status = [
{ name: "help", type: "LISTENING" }, { 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: "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: 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: "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: 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: "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; let i = 0;
@ -56,15 +56,15 @@ class Ready extends BaseEvent {
hiddenGuild = await client.guilds.fetch("568120814776614924"); hiddenGuild = await client.guilds.fetch("568120814776614924");
tUsers = client.users.cache.size - hiddenGuild.memberCount; tUsers = client.users.cache.size - hiddenGuild.memberCount;
tServers = client.guilds.cache.size - 1; tServers = client.guilds.cache.size - 1;
const toShow = status[parseInt(i, 10)]; const toShow = status[i];
client.user.setActivity(`${toShow.name} | v${version}`, { client.user.setActivity(`${toShow.name} | v${version}`, {
type: toShow.type type: toShow.type
}); });
if (status[parseInt(i + 1, 10)]) i++; if (status[i + 1]) i++;
else i = 0; else i = 0;
}, 10 * 1000); // Every 10 seconds }, 10000); // Every 10 seconds
} }
} }