Better format on/ guilds system command

This commit is contained in:
Marius Begby committed 2023-07-07 22:25:54 +02:00
1 parent 217e2f1c2a
commit 03d087518e
1 file changed
+10 -1
+10 -1
View File
@@ -27,13 +27,22 @@ module.exports = {
} }
let guildsList = client.guilds.cache let guildsList = client.guilds.cache
.map((guild) => {
return {
name: guild.name,
memberCount: guild.memberCount
}
})
.sort((a, b) => b.memberCount - a.memberCount)
.map((guild) => `\`${guild.name} (#${guild.memberCount})\``) .map((guild) => `\`${guild.name} (#${guild.memberCount})\``)
.join(', '); .join(', ');
return await interaction.editReply({ return await interaction.editReply({
embeds: [ embeds: [
new EmbedBuilder() new EmbedBuilder()
.setDescription(`**Guilds**\n${guildsList}`) .setDescription(
`**Guilds (${client.guilds.cache.size} total)**\n${guildsList}`
)
.setColor(embedColors.colorInfo) .setColor(embedColors.colorInfo)
] ]
}); });