ComponentsV2 - How to set more than one button
Hello, I want to set ActionRows with maximum 5 buttons but we can't set more, and since on a section the setButtonAccessory is toset one I can't set a range of buttons (for play, stop shuffle, ect..)
21 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!with a SectionBuilder you can only have one accessory (either a button or a thumbnail)
if you want multiple buttons in a row you need to call
.addActionRowComponents
directly on the ContainerBuilder
and add an action row to thatbut it didnt work
old code :
https://pastebin.com/ebidmpUg
Pastebin
D.JS 14.19.3 NodeJS v22 - 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.
not 100% sure but i think this accepts a single
ButtonBuilder
and not an action rowyes that's what i said
but how?
so im assuming that stop, playpause etc are variables to ButtonBuilders
because here the addactionrow function is what i want
exact
okay so you cant add an action row to a
SectionBuilder
you bneed to add it to the ContainerBuilder
:method: ContainerBuilder#addActionRowComponents()
[email protected]
Adds action row components to this container.You'll have to add them outside the section. Sections only support directly adding the button, action rows can't be added
okay
let me retry
like that, yea?
yes
yeah that looks right
Pastebin
D.JS 14.19.3 NodeJS v22 - 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.
ive got the almost same error
the error references a SectionBuilder
the code isn't updated
well
here my components:
not 100% but i think you need to have either a thumbnail or a button on a SectionBuilder
its erroring because you only have text so you can just replace that with a normal TextDisplayBuilder
oh okay
let me try then
thanks it works!
np