From 6b75f550a21ab47606dd9200b1394ecf98bab857 Mon Sep 17 00:00:00 2001 From: "Alex Pooley (@zuedev)" Date: Wed, 22 Jul 2026 15:52:12 +0100 Subject: enhance uex lookup response handling for long item lists --- 174bg/discord-bot/source/commands/uex.js | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to '174bg') diff --git a/174bg/discord-bot/source/commands/uex.js b/174bg/discord-bot/source/commands/uex.js index f2f654f..1a80894 100644 --- a/174bg/discord-bot/source/commands/uex.js +++ b/174bg/discord-bot/source/commands/uex.js @@ -75,7 +75,21 @@ async function uex_lookup_items(interaction) { .map((item) => `- ${item.name} (ID: ${item.id})`) .join("\n"); - await interaction.editReply({ - content: `Found ${matchingItems.length} item(s) matching "${query}":\n${itemList}`, - }); + let replyContent = `Found ${matchingItems.length} item(s) matching "${query}":\n${itemList}`; + + if (replyContent.length > 2000) { + await interaction.editReply({ + content: `Found ${matchingItems.length} item(s) matching "${query}", but the list is too long to display. Attached is a file containing the results.`, + files: [ + { + attachment: Buffer.from(itemList, "utf-8"), name: `uex_items_${query}.txt`, + }, + ], + }); + return; + } else { + await interaction.editReply({ + content: replyContent, + }); + } } \ No newline at end of file -- cgit v1.2.3