Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

425
Views
SyntaxError: token inesperado '??=' // Hacer un bot de cotización con Autocode usando node.js/discord.js

Tratando de hacer un bot de cotización que extraiga de un canal de texto de discordia. soy un novato total en esto, pero creo que este error significa que tengo un problema de biblioteca ya que parece hacer referencia a algo fuera de mi función. Estoy usando autocode si ayuda.

 { "error": { "type": "RuntimeError", "message": "Unexpected token '??='", "stack": "/opt/node_modules/discord.js/src/rest/APIRequest.js:34\n agent ??= new https.Agent({ ...this.client.options.http.agent, keepAlive: true });\n ^^^\n\nSyntaxError: Unexpected token '??='" } }

y aquí está mi código

 const lib = require('lib')({token: process.env.STDLIB_SECRET_TOKEN}); const Discord = require('discord.js'); const client = new Discord.Client(); const channel = client.channels.cache.get(773835211699912724) // you can use `message.channel` instead of this variable if you want to get the message from the channel you send the command const randomMsg = channel.messages.cache.random(1) message.channel.send(`"${randomMsg.content}"`) // Only respond to messages containing the word "hi", "hey", "hello", or "sup" if (context.params.event.content.match(/\bquote\b/i)) { await lib.discord.channels['@0.3.1'].messages.create({ channel_id: context.params.event.channel_id, content: messageContent.join('\n'), message_reference: { message_id: context.params.event.id } }); }
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!