Some typescript error when updating components
Hello there 👋🏻
I created a bot that handles a component interaction - a button click.
OnClick I use ActionRowBuilder to create an updated row object and then send the update by using:
But unless I add a
@ts-ignore
above the updatedRow in the components array my TS won't compile - With the @ts-ignore
it not just only compiles - it also works. The buttons are disabled. Thisis the typehints my IDE (WebStorm) gives me:
This all happens directly in the event handler for InteractionCreate with this signature: async function handler(interaction: Interaction): Promise<any>
I am unsure if my handler signature is wrong or if this is actually something with the library. Could someone take a look?3 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 OPIn TypeScript the
ActionRowBuilder
class has a generic type parameter that specifies the type of component the action row holds:
Thank you!