Interaction Failed

if(json.data?.owns_license == true){
const embed2 = new EmbedBuilder()
.setColor('#FFFFF1')
.setTitle(`Transfer Request`)
.setDescription(`A Transfer Request has been initiated, you will be alerted by DM with the response from the PROP Team.`)
.setTimestamp()

const select = new StringSelectMenuBuilder()
.setMaxValues(3)
.setMinValues(1)
.setCustomId('products')
.setPlaceholder('Pick the products you want to transfer!')
.addOptions(
new StringSelectMenuOptionBuilder()
.setLabel('Airstairs')
.setValue('airstair'),
new StringSelectMenuOptionBuilder()
.setLabel('Placeholder2')
.setValue('placeholder2'),
new StringSelectMenuOptionBuilder()
.setLabel('Placeholder3')
.setValue('placeholder3'),
);

const row2 = new ActionRowBuilder()
.addComponents(select);

const reply = await interaction.reply({ embeds: [embed2] , components: [row2], ephemeral: true });
const collector = reply.createMessageComponentCollector({ componentType: ComponentType.StringSelect })

collector.on('collect', async i => {
const value = i.values[0]
if(!i.user.id == interaction.user.id) return await interaction.reply({ content: 'This selection is not for you!', ephemeral: true })
console.log(i.values)
});
if(json.data?.owns_license == true){
const embed2 = new EmbedBuilder()
.setColor('#FFFFF1')
.setTitle(`Transfer Request`)
.setDescription(`A Transfer Request has been initiated, you will be alerted by DM with the response from the PROP Team.`)
.setTimestamp()

const select = new StringSelectMenuBuilder()
.setMaxValues(3)
.setMinValues(1)
.setCustomId('products')
.setPlaceholder('Pick the products you want to transfer!')
.addOptions(
new StringSelectMenuOptionBuilder()
.setLabel('Airstairs')
.setValue('airstair'),
new StringSelectMenuOptionBuilder()
.setLabel('Placeholder2')
.setValue('placeholder2'),
new StringSelectMenuOptionBuilder()
.setLabel('Placeholder3')
.setValue('placeholder3'),
);

const row2 = new ActionRowBuilder()
.addComponents(select);

const reply = await interaction.reply({ embeds: [embed2] , components: [row2], ephemeral: true });
const collector = reply.createMessageComponentCollector({ componentType: ComponentType.StringSelect })

collector.on('collect', async i => {
const value = i.values[0]
if(!i.user.id == interaction.user.id) return await interaction.reply({ content: 'This selection is not for you!', ephemeral: true })
console.log(i.values)
});
It isn't picking up the collector
6 Replies
d.js toolkit
d.js toolkit5mo 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!
treble/luna
treble/luna5mo ago
add fetchReply: true when replying And some more explanation would be helpful
Goodin
Goodin5mo ago
What do you mean? I am try to have a multi selection menu that just logs the selection Ok i got it I just need it to not say interaction failed now cause I can't reply to it again
treble/luna
treble/luna5mo ago
reply to your collected interactio' then
Unknown User
Unknown User5mo ago
Message Not Public
Sign In & Join Server To View
d.js docs
d.js docs5mo ago
Checking for things to not be equal in JavaScript:
- if (!yourVariable === yourOtherVariable) // !yourVariable is coerced to a boolean value
+ if (yourVariable !== yourOtherVariable) // checks that one is not equal to the other
- if (!yourVariable === yourOtherVariable) // !yourVariable is coerced to a boolean value
+ if (yourVariable !== yourOtherVariable) // checks that one is not equal to the other
- Comparison operators in JavaScript: learn more