mirror of
https://github.com/darksaid98/cadence-discord-bot.git
synced 2026-12-04 14:38:49 +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 {
|
return {
|
||||||
name: guild.name,
|
name: guild.name,
|
||||||
memberCount: guild.memberCount
|
memberCount: guild.memberCount
|
||||||
}
|
};
|
||||||
})
|
})
|
||||||
.sort((a, b) => b.memberCount - a.memberCount)
|
.sort((a, b) => b.memberCount - a.memberCount)
|
||||||
.map((guild) => `\`${guild.name} (#${guild.memberCount})\``)
|
.map((guild) => `\`${guild.name} (#${guild.memberCount})\``)
|
||||||
.join(', ');
|
.join(', ');
|
||||||
|
|
||||||
|
let embedDescription = `**Guilds (${client.guilds.cache.size} total)**\n${guildsList}`;
|
||||||
|
|
||||||
|
if (embedDescription.length >= 4000) {
|
||||||
|
embedDescription = `${embedDescription.slice(0, 3996)}...`;
|
||||||
|
}
|
||||||
|
|
||||||
return await interaction.editReply({
|
return await interaction.editReply({
|
||||||
embeds: [
|
embeds: [
|
||||||
new EmbedBuilder()
|
new EmbedBuilder()
|
||||||
.setDescription(
|
.setDescription(embedDescription)
|
||||||
`**Guilds (${client.guilds.cache.size} total)**\n${guildsList}`
|
|
||||||
)
|
|
||||||
.setColor(embedColors.colorInfo)
|
.setColor(embedColors.colorInfo)
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in new issue
Block a user