From 0733b379951fe6ac4e215a5e4ba2c097c6529c29 Mon Sep 17 00:00:00 2001 From: ChrisChrome Date: Wed, 8 May 2024 09:28:22 -0600 Subject: [PATCH] Refactor pagination logic in index.js --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 3a16eb0..aad90d8 100644 --- a/index.js +++ b/index.js @@ -545,7 +545,7 @@ discord.on("interactionCreate", async (interaction) => { } // Retruns raw text, paginate it into multiple embeds if needed res.text().then((text) => { - const pages = text.match(/[\s\S]{1,2000}(?=\s|$)/g); + const pages = text.match(/[\s\S]{1,2000}(?=\n|$)/g); const embeds = pages.map((page, ind) => ({ title: `Product Text for ${product_id} Pg ${ind + 1}/${pages.length}`, description: `\`\`\`${page}\`\`\``,