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

104
Views
My collector does not seem to work in discord.js
module.exports = {
    data: new SlashCommandBuilder()
        .setName('event-host')
        .setDescription('Hosts/Creates a new Event.'),

    async execute(interaction) 
    {

        if (interaction.member.permissions.has(Permissions.FLAGS.ADMINISTRATOR)) 
        {
        
            return interaction.reply('```Enter the Name of your Event:```')
            .then(() => 
            {
                const filter = m => m.content.startsWith('t');
                const collector = interaction.channel.createMessageCollector({ filter , time: 5000, max: 3 });
                collector.on('collect', m => interaction.channel.send(`Collected ${m.content}`));
                collector.on('end', collected => interaction.channel.send(`Collected ${collected.size} items`));
            });

        }
        else
        {
            return interaction.reply({ content: '```You must have Administrator permissions to be able to use this command!```', ephemeral: true});
        }
    },
};

The collector ends but does not collect. I tried it with awaitMessages too and that also ended with 'catch' but it did not collect either. Maybe it has something to do with async but I am not sure. I tried filter to set to m.author.id == interaction.user.id but that doesn't even make the collector work.

about 4 years ago · Juan Pablo Isaza
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!