Skip to content

Commit

Permalink
Merge pull request #98 from spongedsc/bug/legacy-imagegen-attachments
Browse files Browse the repository at this point in the history
  • Loading branch information
artifishvr authored Jun 23, 2024
2 parents a95b2d9 + a4c4465 commit 73a76f8
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions src/util/models/interactions.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
Expand All @@ -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(
Expand Down

0 comments on commit 73a76f8

Please sign in to comment.