Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

183
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda