Broken button handler: "interaction.isButton is not a function"
Discord.js npm version: 14.16.3
Node.js version: 20.9.0
Since yesterday I cant handle any interaction events where I check if the interaction is a button / chatinputcommand or modalsubmit interaction anymore (I only have these three). They are all build similar.
Here is my handleButtons code for the interactionCreate event:
The error is attached as a screenshot because of discords text limitations.
If you need any more code or other information, please feel free to ask
7 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!
- ✅
Marked as resolved by OPHow are you calling that function
The interactionCreate event is loaded via my event handler: https://pastebin.com/kcRbutFB
Pastebin
eventHandler.ts - Pastebin.com
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
The order of function parameters must match between definition and function call.
- mismatch! you pass an interaction where the client is expected
- mismatch! you pass the client where an interaction is expected
Yeah you pass in a client there
But never account for it, nor do you need to pass one in
Virtually all djs structures have a client property
Ohh thats good to know. Thank you I really did not look at my parameter input there.
Suprisingly it was working all the time, it just broke a few days ago.
I`ll try the other ones as well. If it works I will mark this as solved :)