-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
bugSomething isn't workingSomething isn't workingenhancementNew feature or requestNew feature or request
Description
Currently, our bot seems to be able to display the generated image on Discord as can be seen:
However, on the background I save each image in memory first and then send to the Discord.
images = re.search('\[(.*)\]', req.content.decode("utf-8") ).group(0)
encodings = [e.replace("\\n", "") for e in re.findall('"([^"]*)"', images)]
for encoded in encodings:
with open("image.png", "wb") as fh:
fh.write(b64decode(encoded)) # get rid of this
await message.channel.send(file = discord.File("image.png"))
This approach is not favorable given the fact that it requires lots of I/O operations.
- Find a way to send the image to Discord without saving it in local.
Sometimes it's not able to display the image and sends a meaningless file whose size is 0 KB.
- Find out why this happens and solve it.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingenhancementNew feature or requestNew feature or request