Unknown interaction
Hey! This is a bit of a weird issue, the code that wraps my dropdowns is quite difficult to pick apart on the backend to be able to post here, but this is what's in the active bit, should be relatively easy to understand.
The intention here is that the dropdown has various values (15, 30, 45, 60, 90, 120, -1). If the value is -1, then it's supposed to show a modal in response, however about 70% of the time (not all the time), it gives me an "Unknown interaction" error. This does not happen when the values[0] is not -1. Does anyone know why showing the modal gives an unknown interaction? If there's any explanations to various parts you need, let me know.
Djs: 14.8.0
8 Replies
- What's your exact discord.js
npm list discord.js
and node node -v
version?
- Not a discord.js issue? Check out #other-js-ts.
- Consider reading #how-to-get-help to improve your question!
- Explain what exactly your issue is.
- Post the full error stack trace, not just the top part!
- Show your code!
- Issue solved? Press the button!Common causes of
DiscordAPIError[10062]: Unknown interaction
:
- Initial response took more than 3 seconds ā defer the response *.
- Wrong interaction object inside a collector.
- Two processes handling the same command (the first consumes the interaction, so it won't be valid for the other instance)
* Note: you cannot defer modal or autocomplete value responsesAlso update djs
well this is what I originally thought, there's definitely only one handler for this specific one so it can't be the third, if the non -1's are working it can't be the second, which leaves the first, which could possibly indicate that for some reason
getLengthModal
is taking a while to create. How do you defer a response if when you deferUpdate
it says the interaction has already been acknowledged?this.data is an object, example:
in this case, length is any number
let me just try moving getLengthModal into a static variable
I mean that's what I thought, let me get you the event, all the register method is doing is listing the customid on an object array for the event listener
(this is just a wrapper-ish thing that is auto-registered to client.on etc)
that catch prints the error when it detects one, I took it off showModal just so it wouldn't go through my error handler
that handler just adds some āØ pazazz āØ
honestly I don't know the difference between
let
and var
etc, don't tell the developers
hm
ok
is there an ezpz dumb dumb explanation or is it just an avoidso
etc?
you were right, I didn't notice the
true
that silences the error, the deferUpdate is erroring too š
š¤¦
also I've just found the issue by accident, it's this part:
didn't notice it on the look through, that bit was put there on the assumption I was always going to be deferUpdate'ing, removing this bit fixes it
I did but it still did it, possibly me being a bonehead in that department and restarting the bot too quickly, I've left it commented out for now, the only reason it's there is cause my lazy ass keeps forgetting to defer my dropdowns
my understanding of await was just that it held the thread until it was done, what would that do to impove that bit since thats just updating internal variables?
oh okay, thanks š