amishshah / ytdl-core-discord

A ytdl-core wrapper focused on efficiency for use in Discord music bots
Apache License 2.0
64 stars 26 forks source link

Support for DiscordJS V13 #391

Closed benniblot closed 2 years ago

benniblot commented 3 years ago

Hey, thank you for creating this wonderful peace of code. I started to use ytdl-core-discord instead of ytdl-core because it worked much better especially with live videos. Now after they updated discordjs ytdl-core-discord doesnt work anymore so im kindly asking you to please update it.

Thank, Benni

LehuyH commented 3 years ago

It still works in v13.

Check #392

You need to install correctly @discordjs/voice and get a connection using joinVoiceChannel

benniblot commented 2 years ago

Thanks for your help, just fixed the problem in my code.

lucasfp13 commented 2 years ago

@LehuyH @Benni0109 I tried to follow that #392 instructions but it's not working for me. Maybe you guys have a clue for what's happening here?

Screen Shot 2021-09-19 at 20 13 27
benniblot commented 2 years ago

Hey could you quickly explain what works and what doesnt? (e.g. does it join the voice channel, ...)

lucasfp13 commented 2 years ago

@Benni0109 right now it joins in the voice channel, send the message reply just fine, but no audio from Bot. I even checked these player events, the player goes to 'Playing' state but right after goes to the 'AutoPause' state and nothing plays on Discord

benniblot commented 2 years ago

Could you maybe send me the log from the states? (If you want we could connect via discord so we don't spam this issue) It should look something like this when it works: Audio player transitioned from buffering to playing Audio player transitioned from playing to autopaused Connection transitioned from signalling to connecting Connection transitioned from connecting to connecting Connection transitioned from connecting to connecting Connection transitioned from connecting to connecting Connection transitioned from connecting to ready Audio player transitioned from autopaused to playing [Servername]: Stopped playing Music and left the Voice Channel Connection transitioned from ready to destroyed Audio player transitioned from playing to autopaused

lucasfp13 commented 2 years ago

Here is the log. As you can see at the bottom I logged the AudioPlayer statuses and right after the "Playing" state it goes to the "AutoPaused"

Screen Shot 2021-09-20 at 10 33 33

benniblot commented 2 years ago

Just though about it and you could try to make an var instead of an const for stream. Try this:
var stream = await ytdl("youtube.com/????", { highWaterMark: 1 << 25, filter: 'audioonly', });

This works for me: image

lucasfp13 commented 2 years ago

@Benni0109 hey it worked!! Thanks a lot for the help 🙌🏼

benniblot commented 2 years ago

No Problem, have fun coding :)