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

314
Views
createMessageComponentCollector allow only opponent discord.js@v13

i'm try so hard for createMessageComponentCollector(MessageButton), But I don't know what code would allow the opponent to be able to press it alone.

someone know, please help me!

Here my code:

        const filter = m => m.customId === 'accept' || 'decline' && m.author.id === member.id
        const collector = interaction.channel.createMessageComponentCollector({ filter: filter, max: 1, time: 30000 });

        collector.on('collect', async (m) => {
            if (m.customId === 'accept') {
                await m.deferUpdate();
                return await m.editReply({ content: `ACCEPT!`, embeds: [], components: [] });
            } else if (m.customId === 'decline') {
                await m.deferUpdate();
                return await m.editReply({ content: `DECLINE!`, embeds: [], components: [] });
            }
        });
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I found the code

  • CODE HERE:
        const filter = m => m.customId === 'accept' || 'decline' && m.member.id === member.id
        const collector = interaction.channel.createMessageComponentCollector({ filter: filter, max: 1, time: 30000 });

        collector.on('collect', async (m) => {
            if (m.customId === 'accept') {
                await m.deferUpdate();
                return await m.editReply({ content: `ACCEPT!`, embeds: [], components: [] });
            } else if (m.customId === 'decline') {
                await m.deferUpdate();
                return await m.editReply({ content: `DECLINE!`, embeds: [], components: [] });
            }
        }); 
const filter = m => m.customId === 'accept' || 'decline' && m.author.id === member.id

m.author.id use for djs@v12, but for djs@v13 use m.member.id

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!