mirror of
https://github.com/darksaid98/cadence-discord-bot.git
synced 2026-12-04 06:28:53 +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
+18
-6
@@ -81,11 +81,16 @@ module.exports = {
|
|||||||
const evenShardIndexesString = evenShardIndexes.map(shardInfoToString).join('\n') + 'ㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤ';
|
const evenShardIndexesString = evenShardIndexes.map(shardInfoToString).join('\n') + 'ㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤ';
|
||||||
const oddShardIndexesString = oddShardIndexes.map(shardInfoToString).join('\n');
|
const oddShardIndexesString = oddShardIndexes.map(shardInfoToString).join('\n');
|
||||||
|
|
||||||
return await interaction.editReply({
|
const embedFields = [];
|
||||||
embeds: [
|
|
||||||
new EmbedBuilder()
|
if (currentPageShards.length === 1) {
|
||||||
.setDescription(`**${embedOptions.icons.server} Shard overview - ${shardCount} total shards**\n`)
|
embedFields.push({
|
||||||
.addFields(
|
name: ' ',
|
||||||
|
value: currentPageShards.map(shardInfoToString).join('\n'),
|
||||||
|
inline: false
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
embedFields.push(
|
||||||
{
|
{
|
||||||
name: ' ',
|
name: ' ',
|
||||||
value: evenShardIndexesString,
|
value: evenShardIndexesString,
|
||||||
@@ -96,7 +101,14 @@ module.exports = {
|
|||||||
value: oddShardIndexesString,
|
value: oddShardIndexesString,
|
||||||
inline: true
|
inline: true
|
||||||
}
|
}
|
||||||
)
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return await interaction.editReply({
|
||||||
|
embeds: [
|
||||||
|
new EmbedBuilder()
|
||||||
|
.setDescription(`**${embedOptions.icons.server} Shard overview - ${shardCount} total shards**\n`)
|
||||||
|
.addFields(...embedFields)
|
||||||
.setColor(embedOptions.colors.info)
|
.setColor(embedOptions.colors.info)
|
||||||
.setFooter({ text: `Shard id: ${client.shard.ids[0]}, page ${pageIndex + 1} of ${totalPages}` })
|
.setFooter({ text: `Shard id: ${client.shard.ids[0]}, page ${pageIndex + 1} of ${totalPages}` })
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in new issue
Block a user