fix: Cut /guilds command message reply length to 4000 characters

This commit is contained in:
Marius Begby committed 2023-07-10 00:26:33 +02:00
1 parent 6e68fe604b
commit 8c7d4a07ca
1 file changed
+8 -4
+8 -4
View File
@@ -31,18 +31,22 @@ module.exports = {
return {
name: guild.name,
memberCount: guild.memberCount
}
};
})
.sort((a, b) => b.memberCount - a.memberCount)
.map((guild) => `\`${guild.name} (#${guild.memberCount})\``)
.join(', ');
let embedDescription = `**Guilds (${client.guilds.cache.size} total)**\n${guildsList}`;
if (embedDescription.length >= 4000) {
embedDescription = `${embedDescription.slice(0, 3996)}...`;
}
return await interaction.editReply({
embeds: [
new EmbedBuilder()
.setDescription(
`**Guilds (${client.guilds.cache.size} total)**\n${guildsList}`
)
.setDescription(embedDescription)
.setColor(embedColors.colorInfo)
]
});