How is this messageComponentCollector not working? (discord.js v13)

Basel_Dev

I'm trying to make a message component collector on this message and to only read Select Menu components.

However, the collector seems to exist but it doesn't collect. As when I change something in the Select Menu, the menu says "This interaction failed."

Here's the code:

if (wikiEmbeds.length > 1) {
    let selectMenuOptions = []
    for (let i = 0; i < wikiEmbeds.length; i++) {
        const selectedContent = wikiEmbeds[i];
        if (i == 0) {
            selectMenuOptions.push(
                {
                    label: selectedContent.tableName,
                    value: `${i}`,
                    default: true
                }
            )
        } else {
            selectMenuOptions.push(
                {
                    label: selectedContent.tableName,
                    value: `${i}`
                }
            )
        }      
    }
    let messageRow = new Discord.MessageActionRow()
    .addComponents(
        new Discord.MessageSelectMenu({
            
        })
        .setCustomId("ds3-bosses-menu")
        .addOptions(selectMenuOptions)
    )
    const initialMessage = await interaction.reply({ embeds: [wikiEmbeds[0].embed], components: [messageRow], fetchReply: true })

    const filter = (i) => {  } 
    const collector = initialMessage.channel.createMessageComponentCollector({
        filter,
        componentType: 'SELECT_MENU',
        time: 30000
    })
    console.log(collector)
    collector.on("collect", (selectInteraction) => {
        selectInteraction.reply(" . ")
    })
}

wikiEmbeds is an array of tables, all of them like this { tableName: string, embed: embed }[]

yacine

I am pretty sure it's your filter. Your filter must return true to collect the SelectMenu. Try const filter = (i) => true;

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Discord.js v13 How to prevent mod commands from working on mods?

Discord js v13 channel filter not working

Discord JS v13 Reaction Collector not working

Message collector not working discord js v13

How to filter the member counter in discord.js v13

How can I upgrade to Discord.js V13?

How to get owner of a guild in discord.js v13?

timeout.js discord.js v13 command not working

Discord js v13 setChannel is undefined

Bad words filter is not working correctly discord.js v13

why is message.channel.awaitMessages() not working? | Discord.js V13

How to check if the bot has the right to enter the voice Discord.js v13

How to get speaking status in real time using Discord.js v13

How do I get every minute every voice user in the channel? Discord.js v13

How to send message to specified Channel - Discord.js v13 TypeScript

Discord.js V13 dont know how to check if a user ID is in the current guild

How do I get the owners of all the guilds in discord.js v13?

How can I remove a specific role from everyone that has it in Discord.js v13

How can I get the second mention in a message discord.js v13

How do I make Discord.JS v13 make a role with Administrator permissions?

how to get the guild name that have less than 10 members using discord.js in v13

How can i use global slash command in discord.js v13?

how to set a default value for the dropdown menu with discord.js v13

How to set Discord.js v13 slash commands permissions?

How do I check if a user has a specific role? | discord.js v13

How do I get the last message sent in a channel? | discord.js v13

How to find out whether a server is partnered or not ( discord.js v13 )

Discord.js v13 How to check if mute time is correctly specified?

How do you give a user a role by role ID in Discord.JS V13 (latest)