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

286
Visualizações
Message collector not working discord js v13
        let filter = m => m.author.id === message.author.id
    const collector = message.channel.createMessageCollector({filter, time: 15000, max: 1});

    //name
    let name = message.author.username
    gender()
    //gender

    function gender(){
    embed = embed
    .setTitle(`${message.author.username}'s About Me setup || Gender`)
    .setDescription('Whats your gender/pronounce?')
    .setColor("BLUE")
    message.reply({embeds: [embed]})


    collector.on('collect', m =>{
        let gender = m.content
        m.channel.send(`${gender}`)
        age()
        })
}

    //age
    function age(){
    embed = embed
    .setTitle(`${message.author.username}'s About Me setup || Age`)
    .setDescription('How old are you?')
    .setColor("BLUE")
    message.reply({embeds: [embed]})

    collector.on('collect', m =>{
        let age = m.content
        m.channel.send(`${age}`)
        nationality()
        })
    }
    //nationality
    function nationality() {
    embed = embed
    .setTitle(`${message.author.username}'s About Me setup || Nationality`)
    .setDescription('Where are you from?')
    .setColor("BLUE")
    message.reply({embeds: [embed]})

    collector.on('collect', m =>{
        let nationality = m.content
        m.channel.send(`${nationality}`)
        description()
        })
}
    //description
    function description(){
    embed = embed
    .setTitle(`${message.author.username}'s About Me setup || Age`)
    .setDescription('Describe yourself, tell others your favorite hobbies, favorite movies, ect. in less than 1500 characters')
    .setColor("BLUE")
    message.reply({embeds: [embed]})

    collector.on('collect', m =>{
        if(m.content.length > 1500){
            embed = embed
            .setTitle(':warning: Error! :warning:')
            .setDescription('Your description can only be less than 1500 characters')
            .setColor("BLUE")
            message.reply({embeds: [embed]})
            description()    
        }
        let description = m.content
        m.channel.send(`${description}`)
        })
    }

hey, so I'm trying to make an about me command where when users say "about me setup" it will run through the setup and ask for information like gender, age, desc, etc. (the message.channel.send is just a placeholder, once I get it to work ill put it in an actual database), but it doesn't seem to work like how I expected it to, here's what happens when I try to run the command

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

On line:

const collector = message.channel.createMessageCollector({filter, time: 15000, max: 1});

Your message collector is only collecting messages for 15 seconds, and it will only collect 1 message.

From the DiscordJS documentation, createMessageCollector accepts the following arguments:

  • time: Amount of time in milliseconds the collector should run for
  • max: Number of messages to successfully pass the filter
  • maxProcessed: Number of messages encountered (no matter the filter result)

You can fix this by adjusting those parameters in the creation of your message collector to match your needs, or by reworking your command to accept parameters for gender, age, and nationality and use those parameters to construct the final description response.

On a side note: it looks like you are triggering your bots commands with the L! prefix. This is no longer recommended, as Discord has introduced slash commands.

Bots that are in more than 75 servers will not be able to read message content (it's becoming privileged). I'd recommend switching to slash commands so that you're using the latest way of providing interactions for your bot. There's a great tutorial showing how to create a bot from scratch using slash commands here.

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