Typescript bot using 14.11.0 claims unknown interaction, fails to compile with 14.12.1
From a conversation that began here: https://discord.com/channels/222078108977594368/824411059443204127/1137518310896967720
I am contributing to a Discord.js bot written in TypeScript. Previously, this bot used
[email protected]
, until I updated it recently. I was working on simplifying some Embed code when, for some reason, I began to receive a console error any time I used any slash command. The bot fails/refuses to respond to any command, including ones that I am completely certain that I did not modify. I did not modify the command names or parameters of any command. The error I received is attached. My initial guess was that Discord updated its API, and that I needed to update Discord.js. Indeed, running npm outdated
indicated that, among other things, discord.js should be updated to 14.12.1. So, I ran npm update --save discord.js
. I did not update any packages that did not need to be updated when I did this. When I attempted to reboot the bot using tsc && node dist/bot.js
, I received nearly 100 errors from a file named ../node_modules/discord.js/typings/index.d.ts:1175
. All of them appear to be various forms of "unexpected / incorrect syntax"; I can provide the errors if necessary. When I git stash
ed my code to revert to a version that I know works, I continued to receive the errors from discord.js
when attempting to compile the typescript.
The recommended advice was to update typescript
to ^5.0.0
to accommodate changes made to [email protected]
, but updating Typescript to latest (5.1.6
). Despite updating it (and all other packages) to their latest version, I continue to get errors from the same tile when I attempt to tsc
.
I have since downgraded back to 14.11.0
, but the error persists even after git stash
ing the changes I had made, and I am still not sure what the error is. The code that I am running can be found at https://github.com/earthernsence/ADAnswers-Bot/tree/mirai/5.1.
What makes this an unknown interaction?4 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!Ur typescript version is still at 4.7.4
https://github.com/earthernsence/ADAnswers-Bot/blob/a2f0263be31d5bec99d7041580ed355d8253054c/package.json#L26
When you ran the command, did you get a red text saying "The application failed to respond" in the discord app?
Yes.
(My internet is also spotty; I'm on vacation in a remote area right now.)
I decided to balk on upgrading for now, until I can get a more stable (and not throttled) connection to download the rest of the files I may need.
Anyways, could my error be caused by a connection issue?
Yes, this error occurs because your bot didn't respond within the time limit (5 seconds), but your bot received the call. When your bot received the call, you, in your code, tried to respond to it, but it was already late, and the call was no longer there.
so - lag