Components v2 - SectionBuilder with button
Hey everyone. I'm trying to add a ButtonBuilder to a SectionBuilder, nested in a ContainerBuilder. But when trying to post the message, I get an error:
I tried to look at an error in my code but I cannot find one.
When investigating the Builders, I have this weird accessory in the SectionBuilder:
23 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 OPemoji is undefined
Yeah but that shouldn't matter because there's a label
I have the same issue when passing an emote ^^
What version of djs are you on
14.19.3
Do you have any other buttons in your application
I have some that I used before this djs version, all working fine with ActionRows. But when trying to adapt my code to Components V2, I have this weird ButtonBuilder.
Your section is mal formed. I missed it you need to add a text display component.
I have some but skipped that part because I was above the character limit ^^
I see
Well I need to see the full code. bc what you shared look fine
Oh that's right, I forgot this one. I've edited the post above to have it inside
I'm on it
At least from your snippet, the error is that you are creating a Section with no TextDisplay in it.
Instead, send the button in an ActionRow
I have one, I was above the character limit ^^ I've sent bellow the full SectionBuilder
https://discord.com/channels/222078108977594368/1378332978572165190/1378336247612838009
Ah I see, I missed that part... My bad
Np ^^
I've added some "console.log" in the corresponding "index.mjs" file
It was just the next step because I have the same content in my code. I was looking at djs ^^
Yeah, I've put parsePollFields in this file in gist, but it's the pollsUtils.js
The logs from the console logs in the polls.js file:
And if you want the command input:

Oh
Okay now it works

The Autocomplete did it by itself, I've not touched to this part ^^'
Thanks a lot for the help !