#One or more errors occurred. (Not found: 404) When trying to send a followup Message

1 messages · Page 1 of 1 (latest)

hybrid sparrow
#

I have an embeded Message with a button:
When you press the button it should send an Ephemeral message but it just shows "This interaction failed" and in the coding it throws 404 not found and i have no clue why it is not finding the interaction?
I posted a screenshot of my coding, the red line is the one that fails.

heady vortexBOT
#

_ _

Dismissed message
hybrid sparrow
#

fix did not help, as i need to respond to the newly created components later on

#

and with the interaction response i cannot do that

odd shore
#

set a breakpoint in the catch and check the other properties of the exception. it contains a property that should tell you exactly why it fails

#

on another note, do not access the Result property of a task directly and use await instead (unless you know exactly what you're doing)

#

wait, nvm, 404 probably means that you're not responding to the interaction quickly enough

#

i have no idea what the suggested fix was, but if it was about deferring the response, that's usually what you should do

#

i can only assume createOptions for some reason takes a bit longer and causes the timeout

heady vortexBOT
#
Automated suggestion: Your interaction response takes too long

If your command takes >3 seconds to respond to an interaction, it will time out, and the user will see the infamous "Application did not respond" error message. To fix this, use the CreateResponseAsync with a Deferred_______ type first, and then respond again using the EditResponseAsync method.

Code Example:

context.CreateResponseAsync(InteractionResponseType.DeferredChannelMessageWithSource);
// do your stuff here
context.EditResponseAsync(new DiscordWebhookBuilder());
// you cannot use an InteractionResponseBuilder here.
// If you need to send ephemeral responses, pass an empty
// DiscordInteractionResponseBuilder to the CreateResponseAsync
// and just call .AsEphemeral() on it
odd shore
#

this won't impact whether you can use the newly created components (the EditResponseAsync call will return the message in case you need it)

hybrid sparrow
#

Yeah but how will i respond to my dropdown later on? I didnt find a way with the response to do the waitforselectionasync

#

Also on a sidenote, when i comment out the options, dropdown and components line it also throws the issue

odd shore
odd shore
#

how long is the delay between pressing the button and your code even entering the try?

hybrid sparrow
odd shore
#

a full second round-trip-time is a little concerning but should be fast enough. if immediately responding to the interaction still fails with a 404, we can't really do much about it though.

hybrid sparrow
#

Alright, still thanks for the help

vernal perch
#

think this is the same issues im having

#

getting null returned on all my interactions

odd shore
#

sounds different to me, null where? make a new thread and post some more info about that

vernal perch
#

posted previously, post is called 'all interactions failing'