I have this code, however I don't understand how it is possible to edit the followup message. Thanks!
@bot.command()
async def button(ctx):
view=View()
button_create = Button(label="CREATE", style=discord.ButtonStyle.green)
view.add_item(button_create)
await ctx.send(view=view)
async def button_callback(interaction):
await interaction.response.defer()
await asyncio.sleep(delay=1)
await interaction.followup.send("Hi", ephemeral=True) # How can i edit this message? -_-
button_create.callback = button_callback
I tried to use "interaction.followup.edit_message("Something")", but i got error:
discord.errors.HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body In message_id: Value "Something" is not snowflake.
You can use the built in functions for it:
asd:discord.Message = await interaction.followup.send("Hi!")
await interaction.followup.edit_message(message_id=asd.id,content="Not Hello!")
This is just a basic edit. It requires a message id and a content.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With