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

142
Views
Mi bot se ilumina en verde por un segundo, luego se detiene

En este momento, solo quiero que mi bot reproduzca un archivo directamente desde mi computadora. Aquí está el código:

 const { Client, Intents, MessageEmbed } = require('discord.js'); const { token } = require('./config.json'); const { joinVoiceChannel, createAudioPlayer, createAudioResource} = require('@discordjs/voice'); const { join } = require('path') const client = new Client({ intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MEMBERS, Intents.FLAGS.GUILD_MESSAGES, Intents.FLAGS.GUILD_VOICE_STATES] }); client.once('ready', () => { console.log('Ready!'); }); client.on('messageCreate', msg => { if(msg.content === '!join') { connection = joinVoiceChannel({ channelId: msg.member.voice.channel.id, guildId: msg.guild.id, adapterCreator: msg.guild.voiceAdapterCreator }) } if (msg.content === '!play') { console.log(generateDependencyReport()) const player = createAudioPlayer() let resource = createAudioResource(join('./Downloads/', 'musicFile.mp3')); player.play(resource) connection.subscribe(player) } } client.login(token);

Realmente no tengo problemas para que mi bot se una, pero una vez que le digo que reproduzca el archivo, no reproduce nada. Más bien parpadea en verde por un segundo y luego permanece en silencio. Me aseguré de que todas mis intenciones estén activadas y también verifiqué que todas mis dependencias estén actualizadas. ¡Gracias por leer! Por cierto, discord.js v13 es la versión que estoy ejecutando

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!