ComponentType.SelectMenu not working after [email protected]

It was working just fine before
5 Replies
d.js toolkit
d.js toolkit16mo 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!
! Murali Anand
! Murali AnandOP16mo ago
did anything change after the update?
! Murali Anand
! Murali AnandOP16mo ago
const collector = await msg.createMessageComponentCollector({
componentType: ComponentType.StringSelect,
time: 30000,
max: 1
});

collector.on('collect', async (i) => {
if (i.user.id === interaction.user.id) {

if (i.values[0] == 'above-18') {

const embed = new EmbedBuilder()
.setColor('Green')
.setImage('https://cdn.discordapp.com/attachments/1097420467532472340/1102470374702190623/18.png')
const button = new ActionRowBuilder()
.addComponents(
new ButtonBuilder()
.setCustomId('above-button-verify')
.setLabel('18 +')
.setStyle(ButtonStyle.Success)
)

i.reply({ embeds: [embed], components: [button], ephemeral: true });
}

if (i.values[0] == 'below-18') {

const embed = new EmbedBuilder()
.setColor('Green')
.setImage('https://cdn.discordapp.com/attachments/1097420467532472340/1102472300181331978/18-.png')
const button = new ActionRowBuilder()
.addComponents(
new ButtonBuilder()
.setCustomId('below-button-verify')
.setLabel('18 -')
.setStyle(ButtonStyle.Success)
)

i.reply({ embeds: [embed], components: [button], ephemeral: true });
}
}
});
const collector = await msg.createMessageComponentCollector({
componentType: ComponentType.StringSelect,
time: 30000,
max: 1
});

collector.on('collect', async (i) => {
if (i.user.id === interaction.user.id) {

if (i.values[0] == 'above-18') {

const embed = new EmbedBuilder()
.setColor('Green')
.setImage('https://cdn.discordapp.com/attachments/1097420467532472340/1102470374702190623/18.png')
const button = new ActionRowBuilder()
.addComponents(
new ButtonBuilder()
.setCustomId('above-button-verify')
.setLabel('18 +')
.setStyle(ButtonStyle.Success)
)

i.reply({ embeds: [embed], components: [button], ephemeral: true });
}

if (i.values[0] == 'below-18') {

const embed = new EmbedBuilder()
.setColor('Green')
.setImage('https://cdn.discordapp.com/attachments/1097420467532472340/1102472300181331978/18-.png')
const button = new ActionRowBuilder()
.addComponents(
new ButtonBuilder()
.setCustomId('below-button-verify')
.setLabel('18 -')
.setStyle(ButtonStyle.Success)
)

i.reply({ embeds: [embed], components: [button], ephemeral: true });
}
}
});
Still not working for me : (
Jaworek
Jaworek16mo ago
Its deprecated but still working 1. you should do the user checking in a filter 2. wdym by not working
! Murali Anand
! Murali AnandOP16mo ago
No error in the console and no reply
Want results from more Discord servers?
Add your server