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
- Create a
DiscordMessageBuilder, maybe with buttons, it doesn't matter I think.
- Reply that as a message to the user's command using
commandContext.RespondAsync. Set the return value to a variable message.
- Use
WaitForButtonAsync to wait for a button-press by the user.
- If the user presses a button, the function works as expected; the result is not null, no timeout and the ID is correct.
- Now, edit the message using
message.ModifyAsync with a new DiscordMessageBuilder. Make sure that this DiscordMessageBuilder has different buttons than the original message.
- Use
WaitForButtonAsync on the same message object again.
- 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
Summary
If I have a
DiscordMessagewith a few buttons, it works andmessage.WaitForButtonAsync()catches button presses within a minute just fine.However, if I then proceed to edit the message using
await message.ModifyAsync(editMessageBuilder)whereeditMessageBuilderhas different buttons (if they're the same, no problem, they must be different, also the buttons are added withmessageBuilder.AddActionRowComponent()), if these buttons get pressed they do not get caught byWaitForButtonAsync().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
DiscordMessageBuilder, maybe with buttons, it doesn't matter I think.commandContext.RespondAsync. Set the return value to a variablemessage.WaitForButtonAsyncto wait for a button-press by the user.message.ModifyAsyncwith a newDiscordMessageBuilder. Make sure that thisDiscordMessageBuilderhas different buttons than the original message.WaitForButtonAsyncon the same message object again.WaitForButtonAsyncdoes 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