From ddb436a02ce1a7399819248f61f90d67c988155a Mon Sep 17 00:00:00 2001 From: Atridad Lahiji Date: Mon, 17 Jul 2023 23:43:16 -0600 Subject: [PATCH] better JPG name --- src/commands/fancypic.ts | 7 ++++++- src/commands/pic.ts | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/commands/fancypic.ts b/src/commands/fancypic.ts index 7bf4f5e..93dd513 100644 --- a/src/commands/fancypic.ts +++ b/src/commands/fancypic.ts @@ -117,7 +117,12 @@ export class UserCommand extends Command { const imageAttachment: AttachmentBuilder[] = []; for (let i = 0; i < responseJSON.artifacts.length; i++) { - imageAttachment.push(new AttachmentBuilder(Buffer.from(responseJSON.artifacts[i].base64, 'base64'))); + imageAttachment.push( + new AttachmentBuilder(Buffer.from(responseJSON.artifacts[i].base64, 'base64'), { + name: 'response.jpg', + description: "Himbot's Response" + }) + ); } const newCreditCountResponse = await fetch(`https://api.stability.ai/v1/user/balance`, { diff --git a/src/commands/pic.ts b/src/commands/pic.ts index e0ab9a1..8fd5e69 100644 --- a/src/commands/pic.ts +++ b/src/commands/pic.ts @@ -119,7 +119,12 @@ export class UserCommand extends Command { const imageAttachment: AttachmentBuilder[] = []; for (let i = 0; i < responseJSON.artifacts.length; i++) { - imageAttachment.push(new AttachmentBuilder(Buffer.from(responseJSON.artifacts[i].base64, 'base64'))); + imageAttachment.push( + new AttachmentBuilder(Buffer.from(responseJSON.artifacts[i].base64, 'base64'), { + name: 'response.jpg', + description: "Himbot's Response" + }) + ); } const newCreditCountResponse = await fetch(`https://api.stability.ai/v1/user/balance`, {