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

111
Views
Cómo usar múltiples tokens DiscordJS

Estoy creando bots personalizados para un proyecto y estoy tratando de conectar múltiples tokens con diferentes clientes para poder administrar cada cliente uno por uno.

Mi código real es

 const tokens = ['token_1', 'token_2'] const { Client } = require('discord.js'); for(const token of tokens) { const client = new Client(); client.on('ready', () => { console.log(client.user.id) }); client.login(token) }

Pero imagine que quiero que el segundo bot envíe un mensaje en un canal, ¿cómo hago esto?

Porque si pongo channel.send en for, enviará el mensaje con cada bot, y solo quiero un bot, y creo que client[0] no funciona, si alguien puede ayudar, sería genial

about 4 years ago · Santiago Gelvez
1 answers
Answer question

0

Por ejemplo, puede agregar una nueva matriz que contendrá los clientes

 const { Client } = require('discord.js'); const tokens = ['token_1', 'token_2']; const clients = []; for(const token of tokens) { const client = new Client(); clients.push(client); client.on('ready', () => { console.log(client.user.id); }); client.login(token); }

clients[0] ahora devolverá el primer cliente

about 4 years ago · Santiago Gelvez 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!