Can I make rendering a new embed image fast/instant for users? #2088
-
I want to edit the image in an embed of a sent message. Right now, I'm doing something like this in a bot e = discord.Embed(...)
e.set_image(url='url1')
... # Do stuff
ctx.respond(embed=e)
...
# Trying to update the embed image is buggy for the user
for packet in stream_ndjson_data():
e.set_image(url=packet['url'])
ctx.interaction.edit_original_response(embed=e) However, when I use the command in Discord, the response disappears for ~0.5s before rendering the new embed each time I try to refresh the image, causing the messages from above the embed to jump back down, which is not the effect I wanted. I want to be able to update just the image in-place. Is this possible, or is it a limitation of Discord? For example, might there be some workaround where I could upload the PNG binary as a Thanks in advance for any ideas. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
To start off, the GitHub discussions tab is not intended for help-related questions: please ask in our Discord server, instead. The behavior you're experiencing is a limitation of Discord. When you use |
Beta Was this translation helpful? Give feedback.
To start off, the GitHub discussions tab is not intended for help-related questions: please ask in our Discord server, instead.
The behavior you're experiencing is a limitation of Discord. When you use
ctx.interaction.edit_original_message(embed=e)
to update the embed, Discord treats it as a new message and temporarily removes the original message before displaying the updated one. This causes the 0.5s delay and the jumping effect you're observing. Usingdiscord.File
as a workaround to reference the image directly in the embed is not necessary in this case. Discord handles image URLs in embeds as efficiently as uploading a PNG since they are both stored on Discord's CDN.