mirror of
https://github.com/darksaid98/cadence-discord-bot.git
synced 2026-12-02 14:38:49 +00:00
fix: Fix bug in /shards when shard count is 1 on shown page
This commit is contained in:
1 parent
181dee4b2c
commit
623f4e200f
1 file changed
+24
-12
@@ -81,22 +81,34 @@ module.exports = {
|
||||
const evenShardIndexesString = evenShardIndexes.map(shardInfoToString).join('\n') + 'ㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤ';
|
||||
const oddShardIndexesString = oddShardIndexes.map(shardInfoToString).join('\n');
|
||||
|
||||
const embedFields = [];
|
||||
|
||||
if (currentPageShards.length === 1) {
|
||||
embedFields.push({
|
||||
name: ' ',
|
||||
value: currentPageShards.map(shardInfoToString).join('\n'),
|
||||
inline: false
|
||||
});
|
||||
} else {
|
||||
embedFields.push(
|
||||
{
|
||||
name: ' ',
|
||||
value: evenShardIndexesString,
|
||||
inline: true
|
||||
},
|
||||
{
|
||||
name: ' ',
|
||||
value: oddShardIndexesString,
|
||||
inline: true
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
return await interaction.editReply({
|
||||
embeds: [
|
||||
new EmbedBuilder()
|
||||
.setDescription(`**${embedOptions.icons.server} Shard overview - ${shardCount} total shards**\n`)
|
||||
.addFields(
|
||||
{
|
||||
name: ' ',
|
||||
value: evenShardIndexesString,
|
||||
inline: true
|
||||
},
|
||||
{
|
||||
name: ' ',
|
||||
value: oddShardIndexesString,
|
||||
inline: true
|
||||
}
|
||||
)
|
||||
.addFields(...embedFields)
|
||||
.setColor(embedOptions.colors.info)
|
||||
.setFooter({ text: `Shard id: ${client.shard.ids[0]}, page ${pageIndex + 1} of ${totalPages}` })
|
||||
]
|
||||
|
||||
Reference in new issue
Block a user