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

Not playing any songs #266

Closed Alphaegen closed 1 year ago

Alphaegen commented 1 year ago

The bot does join, but it doesn't play anything and the queue is immediately cleared. The bot is deafened, but that might be normal. I've got ffmpeg installed:

image

My node version is 16.20.0.

Alphaegen commented 1 year ago

There are no errors:

image
Alphaegen commented 1 year ago

What permissions does the bot need?

Alphaegen commented 1 year ago

This is the error if I try to run it using the beta branch:

image
twlite commented 1 year ago

This is the error if I try to run it using the beta branch: image

https://github.com/Androz2091/discord-player/issues/1705

Alphaegen commented 1 year ago

That does fix that specific error, but the bot still joins and doesn't play anything.

Alphaegen commented 1 year ago
image
ShambaC commented 1 year ago

Uninstall ffmpeg static and remove it from node-modules https://github.com/Androz2091/discord-player/issues/1639#issuecomment-1477466885 https://github.com/Androz2091/discord-player/issues/1639#issuecomment-1477793093

Alphaegen commented 1 year ago

Removed ffmpeg-static from package.json, removed package-lock.json and reinstalled node modules. The node_modules folder doesn't contain ffmpeg-static anymore, but it's still doing the same. No music and the queue instantly gets cleared. Any way to debug this the way the person did in the thread you sent above?

twlite commented 1 year ago

Removed ffmpeg-static from package.json, removed package-lock.json and reinstalled node modules. The node_modules folder doesn't contain ffmpeg-static anymore, but it's still doing the same. No music and the queue instantly gets cleared. Any way to debug this the way the person did in the thread you sent above?

what is your discord-player version?

Alphaegen commented 1 year ago

I've got these versions:

image
Alphaegen commented 1 year ago

Someone said missing these could be the problem, but I've got them enabled:

image
itsjustyryr commented 1 year ago

Hey buddy! Try removing ffmpeg-static and run sudo snap install ffmpeg on the /* folder. This was my fix, try doing the same thing. It should work.

Forgot to mention i'm running the beta branch

twlite commented 1 year ago

I've got these versions: image

could you show me your package.json?

Alphaegen commented 1 year ago
image
twlite commented 1 year ago

You are missing @discord-player/extractor package. Oh, just realized, you are using discord-player 5.x, which is outdated. Switch to v6.x

Alphaegen commented 1 year ago

Hey buddy! Try removing ffmpeg-static and run sudo snap install ffmpeg on the /* folder. This was my fix, try doing the same thing. It should work.

I'm afraid I've already uninstalled ffmpeg-static and installed ffmpeg with sudo apt install ffmpeg.

itsjustyryr commented 1 year ago

Hey buddy! Try removing ffmpeg-static and run sudo snap install ffmpeg on the /* folder. This was my fix, try doing the same thing. It should work.

I'm afraid I've already uninstalled ffmpeg-static and installed ffmpeg with sudo apt install ffmpeg.

Same here! When adding a filter to the song, the songs stops playing.(on the beta branch)

twlite commented 1 year ago

Removed ffmpeg-static from package.json, removed package-lock.json and reinstalled node modules. The node_modules folder doesn't contain ffmpeg-static anymore, but it's still doing the same. No music and the queue instantly gets cleared. Any way to debug this the way the person did in the thread you sent above?

The debug logs from the mentioned thread is from discord-player v6. v5 logs are not that great/useful. Plus all the versions below 6.0.0 are deprecated. Could you try the beta branch instead?

Alphaegen commented 1 year ago

I'm now on the beta branch and am now running into the following error. Should I remove ffmpeg-static from package.json again to fix this?


        const error = new Error("Could not extract stream for this track");
                      ^

Error: Could not extract stream for this track
    at GuildQueuePlayerNode.play (/home/server/ngmusicbot/node_modules/discord-player/dist/index.js:985:23)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Object.execute (/home/server/ngmusicbot/commands/music/play.js:59:33)```    
itsjustyryr commented 1 year ago

I'm now on the beta branch and am now running into the following error:


        const error = new Error("Could not extract stream for this track");
                      ^

Error: Could not extract stream for this track
    at GuildQueuePlayerNode.play (/home/server/ngmusicbot/node_modules/discord-player/dist/index.js:985:23)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Object.execute (/home/server/ngmusicbot/commands/music/play.js:59:33)```

I've removed ffmpeg-static from node_modules but not from package.json file.

Alphaegen commented 1 year ago

Removing ffmpeg-static doesn't seem to fix this problem.

itsjustyryr commented 1 year ago

Removing ffmpeg-static doesn't seem to fix this problem.

That's odd. Here, at my end, it worked..

Did you install ffmpeg with snap? Do not install all the modules with npm, use yarn. The yarn install command should be ran after downloading the beta branch. yarn is working better with package management, as for npm installs all the packages mentioned in package-lock.json file.

Alphaegen commented 1 year ago

Completely removing package-lock.json and node_modules, then reinstalling everything with yarn seems to have fixed it. The lyrics button does seem to fail with this error, but everything else works.

Error for lyrics:


      throw er; // Unhandled 'error' event
      ^

SyntaxError: Unexpected token < in JSON at position 0
    at JSON.parse (<anonymous>)
    at SongsClient.<anonymous> (/home/server/ngmusicbot/node_modules/genius-lyrics/dist/songs/client.js:47:37)
    at Generator.next (<anonymous>)
    at fulfilled (/home/server/ngmusicbot/node_modules/genius-lyrics/dist/songs/client.js:5:58)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
Emitted 'error' event on Client instance at:
    at emitUnhandledRejectionOrErr (node:events:394:10)
    at processTicksAndRejections (node:internal/process/task_queues:85:21)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.```
itsjustyryr commented 1 year ago

Completely removing package-lock.json and node_modules, then reinstalling everything with yarn seems to have fixed it. The lyrics button does seem to fail with this error, but everything else works.

Error for lyrics:

      throw er; // Unhandled 'error' event
      ^

SyntaxError: Unexpected token < in JSON at position 0
    at JSON.parse (<anonymous>)
    at SongsClient.<anonymous> (/home/server/ngmusicbot/node_modules/genius-lyrics/dist/songs/client.js:47:37)
    at Generator.next (<anonymous>)
    at fulfilled (/home/server/ngmusicbot/node_modules/genius-lyrics/dist/songs/client.js:5:58)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
Emitted 'error' event on Client instance at:
    at emitUnhandledRejectionOrErr (node:events:394:10)
    at processTicksAndRejections (node:internal/process/task_queues:85:21)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.```

The command for lyrics is fully launched, my bad. I got used with the old branch. I suggest not using it, as the lyrics that get looked up get searched on the Genius website, a website that provides lyrics for your wished track. Apparently, lyrics work here in my end but that is odd. You shouldn't have removed package-lock file, you should've just left it there. Remove node_modules folder, along with yarn.lock file, add back the package-lock.json file from the archive you've downloaded from the beta branch, then use yarn install again.

This should work.

Alphaegen commented 1 year ago

The package-lock file only gets generated when running npm install. It's not a file that's kept within the Git repo. Is there a specific archive I can download with the beta branch + package-lock I've missed?

itsjustyryr commented 1 year ago

The package-lock file only gets generated when running npm install. It's not a file that's kept within the Git repo. Is there a specific archive I can download with the beta branch + package-lock I've missed?

I am sorry. Yes, there is no package-lock. only if you run npm install, I am kind of unfocused. Have you removed the node_modules folder and used yarn install command?

Alphaegen commented 1 year ago

Yes, I've done exactly that 👍 The music plays now, but the lyrics function still gives an error.

itsjustyryr commented 1 year ago

Yes, I've done exactly that 👍 The music plays now, but the lyrics function still gives an error.

That is odd. Mine is fully functional.. Make sure you are on the latest update of the branch or try downloading the lyrics files from the beta branch, from music subfolder of the commands folder from the main folder and from buttons subfolder of the src folder from the branch. Import them in the correct folders and try running it again.

Let me know if it works!

twlite commented 1 year ago

Yes, I've done exactly that 👍 The music plays now, but the lyrics function still gives an error.

have you tried bumping genius-lyrics?

Alphaegen commented 1 year ago

Haven't but I've simply removed the button locally for now. It's not something we're planning on using soon. @skdhg I am wondering tho, why hasn't the ffmpeg-static package been removed from the package.json if it doesn't work?

Alphaegen commented 1 year ago

This is fixed for now. I'm closing this issue.