#interaction.edit_original_message() is broken?

1 messages · Page 1 of 1 (latest)

crude lichen
#

Right now, with interaction.response.send_message(), the response is added to the view. I would like the view to be replaced with a new embed.

I'd think interaction.edit_original_message() would work, but it instead throws an error

    @discord.ui.button(label="Twitch", style=discord.ButtonStyle.primary, emoji=":movie_camera:")
    async def twitch_button_callback(self, button: discord.ui.Button, interaction: discord.Interaction):
        ...
        twitch_embed = discord.Embed()
        await interaction.edit_original_message(embed=twitch_embed)
    goonbot.py:33Ignoring exception in view <eCelebButtonView timeout=180.0 children=2> for item <Button style=<ButtonStyle.primary: 1> url=None disabled=False label='Twitch' emoji=<PartialEmoji animated=False name='🎥' id=None> row=None>:
Traceback (most recent call last):
  File "C:\Users\joshp\dev\goonbot5\.venv\lib\site-packages\discord\ui\view.py", line 375, in _scheduled_task
    await item.callback(interaction)
  File "c:\Users\joshp\dev\goonbot5\util\ecelebs\views.py", line 49, in twitch_button_callback
    await interaction.edit_original_message(embed=twitch_embed)
  File "C:\Users\joshp\dev\goonbot5\.venv\lib\site-packages\discord\interactions.py", line 388, in edit_original_message
    data = await adapter.edit_original_interaction_response(
  File "C:\Users\joshp\dev\goonbot5\.venv\lib\site-packages\discord\webhook\async_.py", line 211, in request
    raise NotFound(response, data)
discord.errors.NotFound: 404 Not Found (error code: 10015): Unknown Webhook
dusk vector
#

Use interaction.message.edit

crude lichen
#

that worked! just had to specify the edited message to not have a view. With a view, it throws an error on the user's side

#

await interaction.message.edit(content=lastest_upload_url, view=None)