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

189
Views
<ShardingManager>.spawn() siendo llamado en un bucle

Parece que mi <ShardingManager>.spawn() se está llamando a sí mismo en un bucle y no estoy seguro de por qué. Seguí el artículo de introducción en el sitio web de la guía Discord.js. Mi versión de Discord.js es 13.0.6. También intenté usar un token de aplicación Discord diferente, pero eso tampoco ayudó.

Parece que index.js se está ejecutando varias veces y no estoy seguro de por qué.

Aquí está mi configuración:

index.ts :

 import { Application } from './Application'; export const application = new Application(); application.initSharding();

Application.ts :

 import { ShardingManager } from 'discord.js'; import dotenv from 'dotenv'; import path from 'path'; export class Application { public async initSharding() { const shardingManager = new ShardingManager('./build/Shard.js', { token: process.env.DISCORD_TOKEN, }); shardingManager.on('shardCreate', shard => { console.log(`[SHARDING MANAGER] LAUNCHED SHARD ${shard.id}`); }); await shardingManager.spawn().catch(reason => console.log(reason)); } constructor() { dotenv.config({ path: path.resolve(__dirname, '../variables.env') }); } }

Shard.ts :

 import { Client, Intents } from 'discord.js'; import { application } from '.'; import { Utils } from './Utils'; export class Shard { private _client: Client; constructor() { this._client = new Client({ intents: [Intents.FLAGS.GUILDS], }); this._client.login(process.env.DISCORD_TOKEN).catch(reason => console.log(reason)); } } new Shard();

Eventualmente obtengo el siguiente error:

 RESPONSE { SIZE: 0, TIMEOUT: 0, [SYMBOL(BODY INTERNALS)]: { BODY: PASSTHROUGH { _READABLESTATE: [READABLESTATE], _EVENTS: [OBJECT: NULL PROTOTYPE], _EVENTSCOUNT: 2, _MAXLISTENERS: UNDEFINED, _WRITABLESTATE: [WRITABLESTATE], ALLOWHALFOPEN: TRUE, [SYMBOL(KCAPTURE)]: FALSE, [SYMBOL(KCALLBACK)]: NULL }, DISTURBED: FALSE, ERROR: NULL }, [SYMBOL(RESPONSE INTERNALS)]: { URL: 'HTTPS://DISCORD.COM/API/V9/GATEWAY/BOT', STATUS: 429, STATUSTEXT: 'TOO MANY REQUESTS', HEADERS: HEADERS { [SYMBOL(MAP)]: [OBJECT: NULL PROTOTYPE] }, COUNTER: 0 } }

Cualquier ayuda es apreciada.

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!