ZerioDev / Music-bot

A complete code to download for a cool Discord music bot !
https://discord.gg/5cGSYV8ZZj
GNU General Public License v3.0
864 stars 1.05k forks source link

Update to discord-player v6 #258

Closed iGameCreep closed 1 year ago

iGameCreep commented 1 year ago

This pull request has been opened to update the bot to the discord-player v6.0.0 version as it is the newest & contains less bugs ( like the song stopping randomly ). This code should be working perfectly, except for the seek command, because it isn't working normally : it comes from the discord-player package but should be fix in a newer version of the package.

Updated commands, events & main file to work with the new methods of the package.

If you find any bugs, don't hesitate to comment on this PR / create an issue on my repository.

Kamil-Pawlak commented 1 year ago

Bot leaves the same second it joins the channel. It says " was manually disconnected from the voice channel, clearing queue...".

iGameCreep commented 1 year ago

Bot leaves the same second it joins the channel. It says " was manually disconnected from the voice channel, clearing queue...".

Hello ! I'll look through this issue.

iGameCreep commented 1 year ago

I am not having this issue, does anything shows up on the console ? If you prefer to continue this issue on Discord, you can open a post in #support ( https://discord.gg/zerio-s-playground-773639842449850368 ). If not, it can be continued here.

sterrebloem commented 1 year ago

Hi, I have a question regarding the /play command. I used your code to update to discord-player v6 and for most part, that fortunately went well. However, I encountered a weird glitch. When I add new songs to the queue, the bot immediately skips to the next song in the queue (doesn't have to be the song you just linked). Same happens with the /search command.

Is there anything I could be possibly doing wrong? Or is this something you encountered before? Many thanks in advance for your answer :)

twlite commented 1 year ago

Hi, I have a question regarding the /play command. I used your code to update to discord-player v6 and for most part, that fortunately went well. However, I encountered a weird glitch. When I add new songs to the queue, the bot immediately skips to the next song in the queue (doesn't have to be the song you just linked). Same happens with the /search command.

Is there anything I could be possibly doing wrong? Or is this something you encountered before? Many thanks in advance for your answer :)

if (!queue.playing) queue.node.play() needs to be if (!queue.isPlaying()) await queue.node.play()

Btw, v6 comes with built-in play method https://github.com/Androz2091/discord-player/blob/2a01f5035a752bc6675c539923ad34243fa068f5/packages/discord-player/src/Player.ts#L311-L346

Things like queue.filters.ffmpeg.getFiltersEnabled().includes(filter) can be replaced with queue.filters.ffmpeg.isEnabled(filter)

iGameCreep commented 1 year ago

Hello @skdhg , thanks for your test of the bot and your bug report ! For the "queue.filters.ffmpeg.isEnabled(filter)", I just used the old command and updated it with the news method, I didn't see that there was this one, I'll try to update with it. For the "if (!queue.isPLaying()) queue.node.play()", I tried to replace them all but then I guess I missed one... I'll be checking my code once again and I'll commit for updates.

iGameCreep commented 1 year ago

Bugs with play and test commands should be fixed ! I guess I missed them while updating methods. Thanks again for letting me know !

iGameCreep commented 1 year ago

Updated code to work with discord-player v6.1.1:

revot334 commented 1 year ago

updated in v8.0.0... update will be out in a few days!