Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

WaitForButtonAsync does not catch button presses from buttons added in a message edit #2376

Copy link
Copy link
@Ascyt

Description

@Ascyt
Issue body actions

Summary

If I have a DiscordMessage with a few buttons, it works and message.WaitForButtonAsync() catches button presses within a minute just fine.

However, if I then proceed to edit the message using await message.ModifyAsync(editMessageBuilder) where editMessageBuilder has different buttons (if they're the same, no problem, they must be different, also the buttons are added with messageBuilder.AddActionRowComponent()), if these buttons get pressed they do not get caught by WaitForButtonAsync().

Instead, the user sees a "This interaction failed." below the message (because the bot did not respond to the interaction in time) and that function then times out after a minute.

What version of the library are you using?

v5.0.0-nightly (make sure you are using the latest nightly!)

What .NET version are you using? Make sure to use the latest patch release for your major version.

.NET 9.0

Operating System

Windows 11

Reproduction Steps

  1. Create a DiscordMessageBuilder, maybe with buttons, it doesn't matter I think.
  2. Reply that as a message to the user's command using commandContext.RespondAsync. Set the return value to a variable message.
  3. Use WaitForButtonAsync to wait for a button-press by the user.
  4. If the user presses a button, the function works as expected; the result is not null, no timeout and the ID is correct.
  5. Now, edit the message using message.ModifyAsync with a new DiscordMessageBuilder. Make sure that this DiscordMessageBuilder has different buttons than the original message.
  6. Use WaitForButtonAsync on the same message object again.
  7. Now, if a user presses a button, WaitForButtonAsync does not catch this interaction anymore.

I can give the full code if necessary, but it'd be a little bit long for this issue. I haven't exactly done the steps above, but I think that unless I'm stupid they should reproduce the problem as well.

Trace Logs


Exceptions or other error messages

Anything else you'd like to share

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.