Skip to content

Commit

Permalink
🐛 fix no image response issues
Browse files Browse the repository at this point in the history
  • Loading branch information
daniwasonline committed Jun 3, 2024
1 parent 434e260 commit f75e679
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 f75e679

Please sign in to comment.