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

153
Views
Cómo puedo hacer que el bot pueda reproducir música en el canal de escenario

Este es el mensaje del cliente Crear en mi código:

 if (msg.author.bot || msg.channel.type == "dm") return; if (msg.content.startsWith(".")){ const player = await createAudioPlayer(); const connection = await joinVoiceChannel({ channelId: "935835998397542400", guildId: "808674100469432360", adapterCreator: msg.guild.voiceAdapterCreator }); await msg.guild.me.voice.setSuppressed(false); const stream = await ytdl("https://www.youtube.com/watch?v=21qNxnCS8WU", { filter: 'audioonly', quality: 'highestaudio', highWaterMark: 1 << 25, }); const resource = await createAudioResource(stream); await player.play(resource); } });

Cuando envío "." en discord, el bot simplemente se une al canal del escenario pero no reproduce música allí. Paso todo el día para arreglar este error pero no funciona

Paquete de versión:

Nodejs: v16.13.0

Discordia.js: v13.6.0

Npm: v8.3.2

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

0

Al final tienes que llamar:

 connection.subscribe(player);

Documentación: https://discord.js.org/#/docs/voice/stable/class/VoiceConnection?scrollTo=subscribe

Guía (con gran explicación): https://discordjs.guide/voice/voice-connections.html#playing-audio

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!