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

256
Views
El bot de Discord no responde/reacciona a nada (JS)

Así que soy nuevo en el mundo de los bots de Discord y quería probarme en este nuevo desafío. Puse la base en funcionamiento después de ver algunos tutoriales y leer algunas publicaciones, pero ahora mi problema es que el bot no reacciona a nada después de iniciarse...

 const Discord = require('discord.js'); const { token } = require('./config.json'); const intents = new Discord.Intents('GUILDS', 'GUILDS_MESSAGES'); const client = new Discord.Client({ intents }); const prefix = '-'; const fs = require('fs'); client.commands = new Discord.Collection(); const commandFiles = fs .readdirSync('./commands/') .filter((file) => file.endsWith('.js')); for (const file of commandFiles) { const command = require(`./commands/${file}`); client.commands.set(command.name, command); } client.once('ready', () => { console.log('Ready!'); }); client.on('message', (message) => { console.log('made it!'); if (!message.content.startsWith(prefix) || message.author.bot) return; const args = message.content.slice(prefix.length).split(/ +/); const command = args.shift().toLowerCase(); if (command === 'ping') { client.commands.get('ping').execute(message, args); } }); client.login(token);

Todo lo que hace es mostrar: '¡Listo!' en la consola Después de eso, ya no reacciona a nada. Ni en discord ni en consola.

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

0

Puede ser porque configuró las intenciones de manera incorrecta.

Prueba y reemplaza:

 const Discord = require('discord.js'); const intents = new Discord.Intents('GUILDS', 'GUILDS_MESSAGES'); const client = new Discord.Client({ intents });

con:

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

También puedes usar una calculadora de intenciones

Además, use messageCreate en lugar de message

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!