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

181
Visualizações
Is it possible to have a bot read a dm message discord.js

So I am making a discord bot and I am making it for 2 servers so I made the bot message me and then I tried to make it wait for a response from me which is either "eb" or "guap" and depending on which one I pick it defines the channel. Heres what I have

client.once('ready', async () => {
    // [beta]
   
    const storedBalances = await Users.findAll();
    storedBalances.forEach(b => currency.set(b.user_id, b));
    console.log(`Logged in as ${client.user.tag}!`);
    client.users.cache.get('461694991467544577').send('what server').then((msg) => {
        console.log("are we making it this far")
        msg.channel.awaitMessages({ filter: (m) => { return true }, max: 1 }).then((collected) => {
            console.log(collected);
            if (collected.first().content === "guap") {
                client.channels.fetch("724610473982558221").then((c) => {
                    channel = c;
                })
                console.log("fetching guaps server");
            }
            if (collected.first().content === "eb") {
                client.channels.fetch("961598555515158568").then((c) => {
                    channel = c;
                })
                console.log("fetching eb's server");
            }
        }).catch(()=>{
            console.log("AwaitMessages Failed");
        })
    });

});


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