Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

105
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda