Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

123
Views
Await component doesn't send OK

I would like to do a await message and list for my setWelcome but it does not send me Ok when I select in the Select menu and I do not know if it is good for the after

const embed = new MessageEmbed()
            .setColor("#0099ff")
            .setTitle("Configuration du message de bienvenue")
            .setDescription("Veuillez choisir le type de bienvenue !")
    
        const row = new MessageActionRow()
            .addComponents(
                new MessageSelectMenu()
                    .setCustomId('type')
                    .setPlaceholder('Choisir le type de bienvenue')
                    .addOptions([
                        {
                            label: 'image',
                            description: 'Le type de bienvenue sera une image',
                            value: 'image',
                            emoji: '๐Ÿ–ผ๏ธ'
                        },
                        {
                            label: 'message',
                            description: 'Le type de bienvenue sera un message',
                            value: 'message',
                            emoji: '๐Ÿ“'
                        },
                    ]),
            );

        const message = await interaction.reply({ embeds: [embed], components: [row] })

        const filter = i => {
            return i.user.id === interaction.user.id;
        };
        
        interaction.channel.awaitMessageComponent({ filter, componentType: 'SELECT_MENU', time: 30000 })
            .then(interaction => interaction.deferReply("Ok"))
            .catch(err => console.log(`No interactions were collected.` + err));
    }
}
about 4 years ago ยท Juan Pablo Isaza
1 answers
Answer question

0

You're using .deferReply() to reply a content, while .deferReply() has only 2 options: ephemeral and fetchReply.

interaction.channel.awaitMessageComponent({ 
   filter, 
   componentType: 'SELECT_MENU', 
   time: 30000 
})
.then((i) => i.reply({ content: 'ok' }))
.catch((e) => console.log(e));
  • .deferReply() sends a "Bot is thinking" message, which increases the application command's reply time from 3 seconds to 15 minutes.
about 4 years ago ยท Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
ยฉ 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!