#DSharpPlus.Interactivity doesn't work

1 messages · Page 1 of 1 (latest)

waxen tusk
#

InteractivityConfiguration:

discordClient.UseInteractivity(new DSharpPlus.Interactivity.InteractivityConfiguration()
        {
            Timeout = TimeSpan.FromDays(3),
            ButtonBehavior = ButtonPaginationBehavior.Disable,
            ResponseBehavior = InteractionResponseBehavior.Respond,
            ResponseMessage = "You can't use this interaction",
            AckPaginationButtons = true
        });```

Button logic (button invokes 100%):
```csharp
 await args.Message.ModifyAsync(newMessageAccept);
 await args.Interaction.CreateResponseAsync(InteractionResponseType.DeferredMessageUpdate);
 var result = await args.Message.WaitForButtonAsync(member);

if (!result.TimedOut)
{
    if (/*button1*/)
    {
     await args.Message.ModifyAsync(newMessage);
     await result.Result.Interaction.CreateResponseAsync(InteractionResponseType.DeferredMessageUpdate);
    }
    else if(/*button2*/)
    {
         await args.Message.ModifyAsync(newMessage);
         await result.Result.Interaction.CreateResponseAsync(InteractionResponseType.DeferredMessageUpdate);
    {
}```

I have a message with one button after you click this this message must be changed but nothing happening. I just get 404 error.
jaunty tapir
#

what line do you get the 404?

waxen tusk
#
DSharpPlus.Exceptions.NotFoundException: Not found: 404
   at DSharpPlus.Net.DiscordApiClient.CreateFollowupMessageAsync(UInt64 application_id, String interaction_token, DiscordFollowupMessageBuilder builder)
   at DSharpPlus.Entities.DiscordInteraction.CreateFollowupMessageAsync(DiscordFollowupMessageBuilder builder)
   at DSharpPlus.Interactivity.EventHandling.ComponentEventWaiter.Handle(DiscordClient _, ComponentInteractionCreateEventArgs args)
   at Emzi0767.Utilities.AsyncEvent`2.InvokeAsync(TSender sender, TArgs e, AsyncEventExceptionMode exceptionMode)```
#

It guess the error occurs in the library when trying to respond

brittle wind
#

yes but on what line

waxen tusk
#

Oh, I re-read everything that I wrote and realized that everything I wrote above was a little wrong.

#

The buttons work, but when the button is pressed by a user who does not own the interaction, instead of the message "You can't use this interaction" I see "interaction failed".

waxen tusk
#

The error does doesn't show the line number on which it occurs.

brittle wind
brittle wind
#

In fact, are you familiar with how the debugger works at all?

waxen tusk
waxen tusk
brittle wind
#

You'll want to use the event handler I think

#

I don't think it's easy to explain said code too well

waxen tusk
brittle wind
#

same event as the button

#

but that won't work well with interactivity though

waxen tusk