TS Inconsistency for message components

I was trying to send components using a basic send function from a sendable channel. The docs says I can send an array of ActionRowBuilder which is what I am trying to do but I get a TS error. When looking at the typings we can see that components from BaseMessageOptions doesn't have ActionRowBuilder as option. Are the types or the docs wrong? Or am I missing something?
No description
No description
3 Replies
d.js toolkit
d.js toolkit2w ago
- 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 OP
d.js docs
d.js docs2w ago
In TypeScript the ActionRowBuilder class has a generic type parameter that specifies the type of component the action row holds:
const row = new ActionRowBuilder<ButtonBuilder>().addComponents(button)
const row = new ActionRowBuilder<StringSelectMenuBuilder>().addComponents(selectMenu)
const row = new ActionRowBuilder<TextInputBuilder>().addComponents(textInput)
const row = new ActionRowBuilder<ButtonBuilder>().addComponents(button)
const row = new ActionRowBuilder<StringSelectMenuBuilder>().addComponents(selectMenu)
const row = new ActionRowBuilder<TextInputBuilder>().addComponents(textInput)
Koyamie
KoyamieOP2w ago
solved it out thanks <3 will keep in mind

Did you find this page helpful?