const row = new MessageActionRow().addComponents(
new MessageButton()
.setCustomId("1")
.setStyle("PRIMARY")
.setLabel("button 1"),
new MessageButton()
.setCustomId("2")
.setStyle("PRIMARY")
.setLabel("button 2"),
new MessageButton()
.setCustomId("3")
.setStyle("PRIMARY")
.setLabel("button 3")
);
collected.reply({ content: "YEYEYEEE TEXT", components: [row], ephemeral: true})
const filter = (interaction) => {
if(interaction.user.id === message.author.id) return true;
return interaction.reply({ content: "An error has occurred", ephemeral: true })
}
const collectorValue1 = message.channel.createMessageComponentCollector({filter, max: 1})
collectorValue1.on("end", (ButtonInteraction) => {
const id = ButtonInteraction.first().customId;
if(id == '1') {
ButtonInteraction.first().reply({ content: "CONTENT", ephemeral: true })
} else if(id == '2') {
ButtonInteraction.first().reply({ content: "CONTENT", ephemeral: true })
} else if(id == '3') {
ButtonInteraction.first().reply({ content: "CONTENT.", ephemeral: true })
}
})
I would like when the buttons are created they are multiple executable, however I can only use the button once, after that I always get the message “This interaction failed.” how can I make the buttons multiple executable?