aboutsummaryrefslogtreecommitdiff
path: root/174bg
diff options
context:
space:
mode:
Diffstat (limited to '174bg')
-rw-r--r--174bg/discord-bot/source/commands/uex.js20
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