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

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

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