msg = await interaction.response.send_message(content='. . .')
while True:
view = PickOne(interaction.author.id, 300)
view.add_item(disnake.ui.Button(style=disnake.ButtonStyle.grey, label="left", custom_id="1"))
view.add_item(disnake.ui.Button(style=disnake.ButtonStyle.grey, label="set", custom_id="3"))
view.add_item(disnake.ui.Button(style=disnake.ButtonStyle.grey, label="rait", custom_id="5"))
await interaction.response.edit_original_message(content="SDFDS", view=view)```
#help me pls edit message!
1 messages ยท Page 1 of 1 (latest)
-d disnake.Interaction.edit_original_response
await edit_original_response(content=..., *, embed=..., embeds=..., file=..., files=..., attachments=..., view=..., components=..., suppress_embeds=..., allowed_mentions=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Edits the original, previously sent interaction response message.
This is a lower level interface to [`InteractionMessage.edit()`](https://docs.disnake.dev/page/api.html#disnake.InteractionMessage.edit "disnake.InteractionMessage.edit") in case you do not want to fetch the message and save an HTTP request.
This method is also the only way to edit the original response if the message sent was ephemeral.
Note
If the original response message has embeds with images that were created from local files (using the `file` parameter with [`Embed.set_image()`](https://docs.disnake.dev/page/api.html#disnake.Embed.set_image "disnake.Embed.set_image") or [`Embed.set_thumbnail()`](https://docs.disnake.dev/page/api.html#disnake.Embed.set_thumbnail "disnake.Embed.set_thumbnail")), those images will be removed if the messageโs attachments are edited in any way (i.e. by setting `file`/`files`/`attachments`, or adding an embed with local files).
Changed in version 2.6: This function was renamed from `edit_original_message`.
cont.
btw why you're running all in a while True loop?
Well idk what you've done before this piece of code that you shared
the error originates from the msg var
this means that you have already responded the interaction before
I can't say where since you cut the code
User Input Error
You must either provide a valid message to paste, or reply to one.
The lookup strategy for a message is as follows (in order):
- Lookup by '{channel ID}-{message ID}' (retrieved by shift-clicking on 'Copy ID')
- Lookup by message ID (the message must be in the context channel)
- Lookup by message URL
Pastebin
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
up
-paste
I've uploaded this message to paste, you can view it here: https://paste.disnake.dev/?id=1672577782127159&language=python
You're storing the message you send with. . . .
You can just do msg.edit() then
if msg.edit gives an error of interaction because there is no answer.
Well, it shouldn't since you've already responded to the interaction. Whats the error you get?
interactions methods returns None
Damn. You're right. I shouldn't try to assist when I'm still in bed ๐
๐
Well edit_original_message is a method of disnake.Interaction
also .response just need to be used once to respond to the interaction
you're using it everywhere
you're already responding to the interaction at the start of the callback with
await interaction.response.defer()
he successfully changed everything, but he wrote
it changes the button, but says no answer why
Well I don't know what you've changed
send the edited code
btw it's probably because you haven't responded to an interaction
-paste
I've uploaded this message to paste, you can view it here: https://paste.disnake.dev/?id=1672578510094316&language=python
View callback looks a bit strange. If you can call it that
ya ๐
Well you haven't really done anything after deferring the interaction, you're using the channel object to send a response
why are you using
while True:
and
await view.wait()?
I hate when ppl use view.wait()
btw i don't remember if after a defer you need to edit the original message or jut send a response using the interaction
You can use inter.send
And it will choose the right one depending on if you deferred or not
But what if I want psuedo low level programming and the hassle of dealing with views? ๐
use lowlevel
Haha, Sabrina can you share your PickOne custom view? You should ideally be setting up the logic for the buttons in there if you're going to be using views
the former, or send a followup