In the current implementation of dalle.js, openAI returns a link to the resulting image. Mimir then edits his response with this link, which Discord then automatically embeds with the image at that link into the channel.
This is fine, however it makes it impossible to access those images after a long time has passed. They will still appear in the discord chat history but you won't be able to save them to your local machine. Additionally, trying to access the link will result in an auth error.
For this reason, we need to adjust the code to do the following:
Save image from response image link into *.png file.
Edit response with resulting .png file.
This can be done because waifu.js currently handles images in this way, so we can use that as reference.
In the current implementation of dalle.js, openAI returns a link to the resulting image. Mimir then edits his response with this link, which Discord then automatically embeds with the image at that link into the channel.
This is fine, however it makes it impossible to access those images after a long time has passed. They will still appear in the discord chat history but you won't be able to save them to your local machine. Additionally, trying to access the link will result in an auth error.
For this reason, we need to adjust the code to do the following:
This can be done because waifu.js currently handles images in this way, so we can use that as reference.