Skip to content

Commit 906640e

Browse files
committed
fix guild count
1 parent 525a0b4 commit 906640e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/commands/user/global-stats.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@ export default {
5454
const currentCountOfGuild = counts.find(e => e.guildId === interaction.guildId)?.count || 0;
5555
const bestCountOfGuild = counts.find(e => e.guildId === interaction.guildId)?.best || 0;
5656
const currentGuildName = (await interaction.client.guilds.fetch()).find(e => e.id === interaction.guildId)?.name;
57-
const allGuilds = await interaction.client.guilds.fetch().then(guilds => guilds.size);
57+
58+
const guilds = await interaction.client.cluster?.fetchClientValues("guilds.cache.size");
59+
const allGuilds = guilds?.reduce((acc, gc) => Number(acc) + Number(gc), 0);
5860

5961
let reply = await __(`replies.global_top_${type}`, currentGuildName, rank, allGuilds, type === "best" ? bestCountOfGuild : currentCountOfGuild)(interaction.guildId);
6062
if (rank === 1) reply += " 👑";

0 commit comments

Comments
 (0)