mirror of
https://github.com/darksaid98/cadence-discord-bot.git
synced 2026-12-03 06:28:53 +00:00
fix: Cut /guilds command message reply length to 4000 characters
This commit is contained in:
1 parent
6e68fe604b
commit
8c7d4a07ca
1 file changed
+8
-4
@@ -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)
|
||||
]
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user