Editing multiple action rows

I am having issues when I try to edit multiple action rows (Buttons)
11 Replies
d.js toolkit
d.js toolkit•5mo 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!
fedee
fedee•5mo ago
const ActionRows = interaction.message.components;

ActionRows.forEach(rows => {
rows.components.forEach(button => {
const isGemOrBoom = positions.has(button.custom_id);

button.data.label = isGemOrBoom ? '💎' : '💣'
button.data.style = isGemOrBoom ? 3 : 4
button.data.type = isGemOrBoom ? 3 : 4


button.data.disabled = true; // Disable all buttons
console.log(button.data)

ButtonBuilder = button
})
setTimeout(async function(){
await interaction.update({ content: '💥 Boom! You lose!', components: [interaction.message.components] });

}, 2000)
const ActionRows = interaction.message.components;

ActionRows.forEach(rows => {
rows.components.forEach(button => {
const isGemOrBoom = positions.has(button.custom_id);

button.data.label = isGemOrBoom ? '💎' : '💣'
button.data.style = isGemOrBoom ? 3 : 4
button.data.type = isGemOrBoom ? 3 : 4


button.data.disabled = true; // Disable all buttons
console.log(button.data)

ButtonBuilder = button
})
setTimeout(async function(){
await interaction.update({ content: '💥 Boom! You lose!', components: [interaction.message.components] });

}, 2000)
treble/luna
treble/luna•5mo ago
and what exactly is your issue? #how-to-get-help
fedee
fedee•5mo ago
when I update it
treble/luna
treble/luna•5mo ago
okay, but what is your issue
fedee
fedee•5mo ago
Invalid form data
fedee
fedee•5mo ago
No description
fedee
fedee•5mo ago
No description
treble/luna
treble/luna•5mo ago
show where you update tem
fedee
fedee•5mo ago
Right there
treble/luna
treble/luna•5mo ago
components is already an array no need to wrap it in one again