From f75e679d150863a42ebaa7c882c324688afb826e Mon Sep 17 00:00:00 2001 From: Dani Date: Sun, 2 Jun 2024 19:06:01 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix=20no=20image=20response=20is?= =?UTF-8?q?sues?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/util/models/interactions.js | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/src/util/models/interactions.js b/src/util/models/interactions.js index fe23a68..1f66cfd 100644 --- a/src/util/models/interactions.js +++ b/src/util/models/interactions.js @@ -389,7 +389,18 @@ export class InteractionMessageEvent { if (imageGen === null) return await responseMsg.edit({ content: textResponse }).catch(() => null); - return responseMsg + responseMsg + .reply({ + files: [ + { + attachment: imageGen, + name: "generated0.jpg", + }, + ], + }) + .catch(() => {}); + + return await responseMsg .edit({ content: final?.trim()?.length >= 2000 ? "" : final, files: [ @@ -399,13 +410,12 @@ export class InteractionMessageEvent { name: "response.md", } : null, - { - attachment: imageGen, - name: "generated0.jpg", - }, ].filter((e) => e !== null), }) - .catch(() => null); + .catch((e) => { + console.error(e); + return e; + }); } async createResponse(