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
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