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

136
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 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