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•12mo 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
fedeeOP•12mo 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•12mo ago
and what exactly is your issue? #how-to-get-help
fedee
fedeeOP•12mo ago
when I update it
treble/luna
treble/luna•12mo ago
okay, but what is your issue
fedee
fedeeOP•12mo ago
Invalid form data
fedee
fedeeOP•12mo ago
No description
fedee
fedeeOP•12mo ago
No description
treble/luna
treble/luna•12mo ago
show where you update tem
fedee
fedeeOP•12mo ago
Right there
treble/luna
treble/luna•12mo ago
components is already an array no need to wrap it in one again
Want results from more Discord servers?
Add your server