From 1359b0bfa578387a27506f8201a23fe1b4eadcf1 Mon Sep 17 00:00:00 2001 From: Dani Date: Sun, 19 May 2024 01:49:43 -0700 Subject: [PATCH] long responses using the imagine module should return an updated image --- src/util/models/interactions.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/util/models/interactions.js b/src/util/models/interactions.js index 18bccf8..4c1f52e 100644 --- a/src/util/models/interactions.js +++ b/src/util/models/interactions.js @@ -391,13 +391,19 @@ export class InteractionMessageEvent { return responseMsg .edit({ - content: final, + content: final?.trim?.length >= 2000 ? "" : final, files: [ + final.trim().length >= 2000 + ? { + attachment: Buffer.from(final, "utf-8"), + name: "response.md", + } + : null, { attachment: imageGen, name: "generated0.jpg", }, - ], + ].filter((e) => e !== null), }) .catch(() => null); }