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

208
Views
agente ??= nuevo https.Agente({ ...this.client.options.http.agent, keepAlive: true });

Así que estoy aprendiendo a hacer un bot en discord usando discord.js

este es mi bot.js

 require("dotenv").config(); const { Client } = require('discord.js'); const client = new Client(); client.login(process.env.DISCORD_TOKEN_KEY);

este es mi archivo package.json :

 { "name": "aibot", "version": "1.0.0", "description": "", "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", "start": "node ./src/bot.js", "dev": "nodemon ./src/bot.js" }, "keywords": [], "author": "", "license": "ISC", "dependencies": { "discord.js": "^13.2.0", "dotenv": "^10.0.0" } }

Entonces, cuando ejecuto node ./src/bot.js , recibo este error:

 PS E:\RIYA\AIBOT> node -v v14.18.0 PS E:\RIYA\AIBOT> node ./src/bot.js E:\RIYA\AIBOT\node_modules\discord.js\src\rest\APIRequest.js:33 agent ??= new https.Agent({ ...this.client.options.http.agent, keepAlive: true }); ^^^ SyntaxError: Unexpected token '??=' at wrapSafe (internal/modules/cjs/loader.js:1001:16) at Module._compile (internal/modules/cjs/loader.js:1049:27) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10) at Module.load (internal/modules/cjs/loader.js:950:32) at Function.Module._load (internal/modules/cjs/loader.js:790:12) at Module.require (internal/modules/cjs/loader.js:974:19) at require (internal/modules/cjs/helpers.js:93:18) at Object.<anonymous> (E:\RIYA\AIBOT\node_modules\discord.js\src\rest\RESTManager.js:4:20) at Module._compile (internal/modules/cjs/loader.js:1085:14) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)

¿Qué debo hacer? No sé mucho sobre NodeJs y no puedo descubrir cómo resolver este problema.

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

Debe actualizar node.js a v16.6 o posterior, según los documentos (desplácese hacia abajo hasta "Instalación").

about 4 years ago · Juan Pablo Isaza Report

0

Debe actualizar su Nodo a la versión 16.6.0 o posterior para que funcione y modifique su

2da y 3ra lineas

de código a:

 const { Client, Intents } = require('discord.js'); const client = new Client({ intents: [Intents.FLAGS.GUILDS] });

Para prevenir

[Símbolo (código)]: error 'CLIENT_MISSING_INTENTS'

Lea más de la documentación https://discord.js.org/#/docs/main/stable/general/welcome

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