#Unknown Interaction [Tag-ish]

1 messages · Page 1 of 1 (latest)

placid cypress
#

So, you got Unknown Interaction, this typically means that you had an interaction that took more than 3s to reach the first acknowledgment

For example, you made a request to a 3rd party API, which took say 5 seconds to respond, when you go to do reply(...) your interaction has expired and thus Unknown Interaction

#

A common way to solve this is to defer first:

await interaction.deferReply({ ephemeral, ... });

const res = await longRunninTask(...);

await interaction.editReply(...);

Deferring gives you 15 minutes to eventually respond.

To check how long your Interaction has been alive (and thus maybe dead) add this to your code as desired:

console.log(`<Meaningful Message> ${Number(Date.now()) - <BaseInteraction>.createdTimestamp}ms`);
#

Note, you cannot defer:
• An Interaction that responds with a Modal (you can defer the submit of a modal itself)
• An Autocomplete