diff options
| author | Alex Pooley (@zuedev) <zuedev@gmail.com> | 2026-07-22 15:52:12 +0100 |
|---|---|---|
| committer | Alex Pooley (@zuedev) <zuedev@gmail.com> | 2026-07-22 15:52:12 +0100 |
| commit | 6b75f550a21ab47606dd9200b1394ecf98bab857 (patch) | |
| tree | d91ff2b069ca0b8cfd146767e0d9073e12151142 | |
| parent | c6c9ad5d948a38c05e6a7d75097ca8a54c5a33ae (diff) | |
| download | unnamed-group-6b75f550a21ab47606dd9200b1394ecf98bab857.tar unnamed-group-6b75f550a21ab47606dd9200b1394ecf98bab857.tar.gz unnamed-group-6b75f550a21ab47606dd9200b1394ecf98bab857.tar.bz2 unnamed-group-6b75f550a21ab47606dd9200b1394ecf98bab857.tar.xz unnamed-group-6b75f550a21ab47606dd9200b1394ecf98bab857.zip | |
enhance uex lookup response handling for long item lists
| -rw-r--r-- | 174bg/discord-bot/source/commands/uex.js | 20 |
1 files changed, 17 insertions, 3 deletions
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 |
