diff --git a/events/guildCreate.js b/events/guildCreate.js index 2a9125d..87dce62 100644 --- a/events/guildCreate.js +++ b/events/guildCreate.js @@ -12,11 +12,9 @@ module.exports = { return; } await registerSlashCommands(guild.client.user.id, guild.id); - guild.client.user.setActivity( - `Music in ${client.guilds.cache.size} Servers!`, - { - type: "PLAYING", - } - ); + const guilds = client.guilds.cache.map((guild) => guild.id); + client.user.setActivity(`Music in ${guilds.length} Servers!`, { + type: "PLAYING", + }); }, }; diff --git a/events/guildDelete.js b/events/guildDelete.js index b5c6f48..7e7ee82 100644 --- a/events/guildDelete.js +++ b/events/guildDelete.js @@ -1,11 +1,9 @@ module.exports = { name: "guildDelete", async execute(guild) { - guild.client.user.setActivity( - `Music in ${client.guilds.cache.size} Servers!`, - { - type: "PLAYING", - } - ); + const guilds = client.guilds.cache.map((guild) => guild.id); + client.user.setActivity(`Music in ${guilds.length} Servers!`, { + type: "PLAYING", + }); }, }; diff --git a/events/ready.js b/events/ready.js index cf93988..423a0b0 100644 --- a/events/ready.js +++ b/events/ready.js @@ -14,7 +14,8 @@ module.exports = { } }); console.log(`Ready! Logged in as ${client.user.tag}`); - client.user.setActivity(`Music in ${client.guilds.cache.size} Servers!`, { + const guilds = client.guilds.cache.map((guild) => guild.id); + client.user.setActivity(`Music in ${guilds.length} Servers!`, { type: "PLAYING", }); },