#help me pls edit message!

1 messages ยท Page 1 of 1 (latest)

acoustic geyser
#
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)```
drifting quail
#

-d disnake.Interaction.edit_original_response

limpid oracleBOT
#

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.
drifting quail
#

btw why you're running all in a while True loop?

acoustic geyser
#

removed the loop, put 'edit_original_response', nothing has changed.

drifting quail
#

Well idk what you've done before this piece of code that you shared

acoustic geyser
drifting quail
#

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

acoustic geyser
#

Where can I upload it to show it?

drifting quail
#

you misunderstood

#

I didn't tell you to delete the msg variable

drifting quail
#

-paste

limpid oracleBOT
# drifting quail -paste
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):

  1. Lookup by '{channel ID}-{message ID}' (retrieved by shift-clicking on 'Copy ID')
  2. Lookup by message ID (the message must be in the context channel)
  3. Lookup by message URL
drifting quail
#

well

#

wait a moment

#

.paste

#

I don't remember the command

acoustic geyser
drifting quail
acoustic geyser
#

up

drifting quail
limpid oracleBOT
celest cloud
#

You're storing the message you send with. . . .
You can just do msg.edit() then

acoustic geyser
#

if msg.edit gives an error of interaction because there is no answer.

celest cloud
#

Well, it shouldn't since you've already responded to the interaction. Whats the error you get?

acoustic geyser
drifting quail
celest cloud
#

Damn. You're right. I shouldn't try to assist when I'm still in bed ๐Ÿ˜‚

acoustic geyser
#

๐Ÿ˜‚

drifting quail
#

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()
acoustic geyser
#

he successfully changed everything, but he wrote

#

it changes the button, but says no answer why

drifting quail
#

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

acoustic geyser
drifting quail
limpid oracleBOT
celest cloud
#

View callback looks a bit strange. If you can call it that

acoustic geyser
drifting quail
#

Well you haven't really done anything after deferring the interaction, you're using the channel object to send a response

viscid zealot
#

why are you using
while True:
and
await view.wait()?
I hate when ppl use view.wait()

drifting quail
#

btw i don't remember if after a defer you need to edit the original message or jut send a response using the interaction

celest cloud
#

You can use inter.send

#

And it will choose the right one depending on if you deferred or not

celest cloud
viscid zealot
#

use lowlevel

celest cloud
#

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