k4deng
k4deng
DIAdiscord.js - Imagine an app
Created by k4deng on 3/20/2024 in #djs-questions
Help with select menus
hey all, im trying to get a select menu collector working but i cant seem to figure it out... i have two rows, each with one multi select menu in it I am making my collector via
const initialMessage = await interaction.editReply({ embeds: [embed], components: components });

const collector = initialMessage.createMessageComponentCollector({
componentType: ComponentType.StringSelect, time: 10000
});
const initialMessage = await interaction.editReply({ embeds: [embed], components: components });

const collector = initialMessage.createMessageComponentCollector({
componentType: ComponentType.StringSelect, time: 10000
});
which works as expected. I collect when there are changes by:
collector.on('collect', async i => {
const changedValues = i.values

// update db with new elements
// db update is here, ommitted for support readability

await i.update({ content: "" }) // this is so discord doesnt say interaction failed
});
collector.on('collect', async i => {
const changedValues = i.values

// update db with new elements
// db update is here, ommitted for support readability

await i.update({ content: "" }) // this is so discord doesnt say interaction failed
});
the problem is back in discord, the select goes back to what it was before I interacted with it anytime i change it. the code works, the db updates properly my adding and removing the values from an array, but discord does not change correctly any idea why this doesnt work as expected?
4 replies