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

137
Vistas
Grabbing a message mention taking longer than expected (DJS V13)

I'm using message.mentions.members.first() but the problem is that when I ping a user, the bot replies after a long delay.

Video: https://gyazo.com/a8739e60bb86bc68c680731e3d491fee (bot was on clearly)

I've tried switching between networks, but it's still delayed. Let me know if there are any available fixes.

let member = await message.mentions.members.first()
if (!member) return message.channel.send({ content: "You did not mention a member or that member does not exist." })

if (args[0] = "add") {   
    let obj =  member.id
    let bypass = JSON.parse(fs.readFileSync("./bypass.json", "utf-8"))
    bypass.push(obj)

    fs.writeFile('./bypass.json', JSON.stringify(bypass, null, 4), err => {
        if (err) console.log(err);
    })
    message.channel.send({ content: `Added sus to the bypass list!` })
}

if (args[0] === 'remove') {
    let obj
    obj = member.id
    let table = obj
    bypass.push(table)

    fs.writeFile('./bypass.json', JSON.stringify(bypass, null, 4), err => {
        if (err) console.log(err);
    })
}
about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

Sorry for the extremely long wait for an answer but I figured out how to fix it, turns out a line of code that checks for swear words (i used a npm package for the detection of swear words). That line of code couldn't figure out if it was a swear word or something else. Removed it and worked completely fine. Sorry for the trouble.

about 4 years ago · Juan Pablo Isaza Denunciar

0

Read through your code and found two mistakes, message.mentions.users is an array, doesn't return a promise, you therefore don't need to use await, as second error, in the first if statement you only placed one =, while you need two or three to compare.

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