update stats command to reflect all shards
This commit is contained in:
1 parent
4a22b36aa0
commit
5ddd430cbc
2 files changed
+6
-2
No files matched your search
+5
-1
@@ -23,11 +23,15 @@ module.exports = {
|
|||||||
return interaction.send({ content: `You are not allowed to use the bot in this channel.` });
|
return interaction.send({ content: `You are not allowed to use the bot in this channel.` });
|
||||||
}
|
}
|
||||||
const { version } = require("discord.js");
|
const { version } = require("discord.js");
|
||||||
|
const totalGuilds = await client.shard.fetchClientValues("guilds.cache.size").then(results => {
|
||||||
|
return results.reduce((acc, guildCount) => acc + guildCount, 0)
|
||||||
|
});
|
||||||
|
const totalMembers = await client.shard.broadcastEval(c => c.guilds.cache.reduce((acc, guild) => acc + guild.memberCount, 0)).then(data => data.reduce((acc, memberCount) => acc + memberCount, 0));
|
||||||
const stats = new EmbedBuilder()
|
const stats = new EmbedBuilder()
|
||||||
.setColor('#0099ff')
|
.setColor('#0099ff')
|
||||||
.setTitle("Current LPC-Bot Statistics")
|
.setTitle("Current LPC-Bot Statistics")
|
||||||
.setURL(client.config.SupportServer)
|
.setURL(client.config.SupportServer)
|
||||||
.setDescription(`**Channels** : \`${client.channels.cache.size}\`\n**Servers** : \`${client.guilds.cache.size}\`\n**Users** : \`${client.users.cache.size}\``)
|
.setDescription(`**Servers** : \`${totalGuilds}\`\n**Users** : \`${totalMembers}\``)
|
||||||
interaction.send({ embeds: [stats] })
|
interaction.send({ embeds: [stats] })
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
+1
-1
@@ -2,7 +2,7 @@ require('dotenv').config()
|
|||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
Dev: "PRODUCTION",
|
Dev: "PRODUCTION",
|
||||||
Version: "3.2.2",
|
Version: "3.2.3",
|
||||||
Admins: ["362791661274660874"], // Admins of the bot
|
Admins: ["362791661274660874"], // Admins of the bot
|
||||||
DefaultPrefix: "?",
|
DefaultPrefix: "?",
|
||||||
socket: "https://www.linespolice-cad.com/",
|
socket: "https://www.linespolice-cad.com/",
|
||||||
|
|||||||
Reference in new issue
Block a user