Mirai Sozo
DIAdiscord.js - Imagine an app
•Created by Mirai Sozo on 8/5/2023 in #djs-questions
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?9 replies