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

110
Visualizações
How to wait for a response when running a command?

Why is it not waiting for a response? it just runs the whole code Someone told me filter is part of v13 collector options, is there anyway to do this then?

const target = message.mentions.users.first();
        if (!target) return message.reply("you have to mention somebody");
    
        await message.reply(
          `you proposed to ${target}! Is it **YES** or **NO**?`
        );
    
        const filter = (m) =>
          m.content.toLowerCase().startsWith("yes") &&
          !m.author.bot &&
          m.author.target;
    
        const main = message.guild.channels.resolve("706263571562102835");
    
        main.awaitMessages(filter, {
          errors: ["time"],
          max: 1,
          time: 900000,
        });
    
        await message.reply(
          `You e ${target} are now married!`
        );
      },
    };
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

message.author.target does not exist. I believe what you meant to do is

const filter = (m) =>
          m.content.toLowerCase().startsWith("yes") &&
          !m.author.bot &&
          m.author.id == target.id

This means that the filter will only detect messages which: begin with "yes", when the author is not a bot, and when the author's ID the same as the target's ID.

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