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

239
Vistas
I got a syntaxerror on an argument list
async function msge(){
  client.on("message", msg => {
    if (msg.content === `${call}status`) {
      msg.reply('The aqi in Bucharest is ' + await printf())
        .then(message => console.log(`Sent message: ${message.content}`))
        .catch(console.error);
    }
  })
  return console.log("Worked")
}

This is the function that gets the error and i can't get why. This is the error code: SyntaxError: missing ) after argument list

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You cannot use await in here like that:

msg.reply('The aqi in Bucharest is ' + await printf())
                                       ^

Await expects the scope it runs in to be annotated with async. Just put the async keyword next to msg:

client.on("message", async msg => {
                     ^

Alternatively, you could use a Promise. Since you already use it here. You could also just add another .then();

function msge(){
  client.on("message", msg => {
    if (msg.content === `${call}status`) {
      msg.reply('The aqi in Bucharest is ')
        .then(printf) // <-- you may adjust this to match your signature
        .then(message => console.log(`Sent message: ${message.content}`))
        .catch(console.error);
    }
  })
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