Disabling Components

await i.update({ components: [ActionRowBuilder.from(buttonRow.components[0]).setDisabled(true)]});
await i.update({ components: [ActionRowBuilder.from(buttonRow.components[0]).setDisabled(true)]});
Doesnt Work
9 Replies
d.js toolkit
d.js toolkit2y ago
• What's your exact discord.js npm list discord.js and node node -v version? • Post the full error stack trace, not just the top part! • Show your code! • Explain what exactly your issue is. • Not a discord.js issue? Check out #useful-servers.
Professor
ProfessorOP2y ago
<rejected> TypeError: ActionRowBuilder.from(...).setDisabled is not a function
treble/luna
treble/luna2y ago
you can disable components, but not entire actionrows iirc
Professor
ProfessorOP2y ago
await i.update({ components: [ActionRowBuilder.from(buttonRow.components.setDisabled(true))] });
await i.update({ components: [ActionRowBuilder.from(buttonRow.components.setDisabled(true))] });
This Also Not Working <rejected> TypeError: buttonRow.components.setDisabled is not a function
treble/luna
treble/luna2y ago
because components returns an array
Professor
ProfessorOP2y ago
but what should i do now await i.update({ components: [ActionRowBuilder.from(buttonRow.components[0].setDisabled(true))]}); Not Working
treble/luna
treble/luna2y ago
Just loop through the array and set every button or whatever components you have to disabled. I dont entirely know wheter .setDisabled will work outside of builders but you can also use <component>.data.disabled = true
Professor
ProfessorOP2y ago
type in code and show please
treble/luna
treble/luna2y ago
I'm on mobile so i cant and i also think its <component>.data.disabled
Want results from more Discord servers?
Add your server