From 1eac1baa8d03c3ea89778ce94c41716c88cdb501 Mon Sep 17 00:00:00 2001 From: coopw1 <48886919+coopw1@users.noreply.github.com> Date: Sun, 21 Jan 2024 22:19:46 -0500 Subject: [PATCH] Fixed edge case where embed is > 4096 chars --- src/commands/general/big.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/commands/general/big.js b/src/commands/general/big.js index 1b0bf27..f815fc7 100644 --- a/src/commands/general/big.js +++ b/src/commands/general/big.js @@ -31,7 +31,6 @@ module.exports = { description: "Max number of listens to get! Caps at 5000 by default.", type: ApplicationCommandOptionType.Integer, required: false, - minValue: 1000, }, ], }, @@ -117,8 +116,19 @@ module.exports = { let embeds = []; for (let i = 0; i < maxPages; i++) { - embeds[i] = new EmbedBuilder(baseEmbed).setDescription(descriptions[i]); + if (descriptions[i].length > 4096) { + embeds.push( + new EmbedBuilder(baseEmbed) + .setDescription(descriptions[i].slice(0, 4096)) + .addFields({ name: "Overflow", value: descriptions[i].slice(4096) }) + ); + } else { + embeds.push( + new EmbedBuilder(baseEmbed).setDescription(descriptions[i]) + ); + } } + pagination( interaction, embeds,