galnir / Master-Bot

A Discord music bot and dashboard with slash commands, playlist support, Spotify, music quiz, saved playlists, lyrics, gifs and more
MIT License
467 stars 370 forks source link

Bot joins call after a song is requested, and quits when the song is about to play #818

Open barateza opened 8 months ago

barateza commented 8 months ago

Describe the bug Bot joins call after a song is requested, and quits when the song is about to play.

To Reproduce

Expected behavior The bot should stay in the call and play the song.

Screenshots N/A

Desktop:

Additional context

  1. The bot seems to be running just fine otherwise, despite what it just said... image

  2. When requested from YouTube, the music seems to be queued, and controls appear, but the song does not play and the bot kicks itself.

    image

    Lavalink:

2024-03-29 06:00:19.758  INFO 1244651 --- [   XNIO-1 I/O-2] lavalink.server.io.SocketServer          : {"op":"voiceUpdate","guildId":"826863331474145361","sessionId":"643d73e4eaa52e5e1aa755489e046e25","event":{"token":"[censored]","guild_id":"[censored]","endpoint":"brazil11038.discord.media:443"}}
2024-03-29 06:00:19.831  INFO 1244651 --- [  XNIO-1 task-1] lavalink.server.io.RequestLoggingFilter  : GET /loadtracks?identifier=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D2gF_ZIBiKOw%26t%3D13s, client=127.0.0.1
2024-03-29 06:00:45.010  INFO 1244651 --- [  XNIO-1 task-1] l.server.player.AudioLoaderRestHandler   : Got request to load for identifier "ytsearch:Já que me ensinou a beber Muffled 1 hora"
2024-03-29 06:00:45.450  INFO 1244651 --- [ader-2-thread-1] lavalink.server.player.AudioLoader       : Loaded playlist Search results for: Já que me ensinou a beber Muffled 1 hora
2024-03-29 06:00:45.454  INFO 1244651 --- [  XNIO-1 task-1] lavalink.server.io.RequestLoggingFilter  : GET /loadtracks?identifier=ytsearch%3AJ%C3%A1%20que%20me%20ensinou%20a%20beber%20Muffled%201%20hora, client=127.0.0.1
2024-03-29 06:00:45.489  INFO 1244651 --- [   XNIO-1 I/O-2] lavalink.server.io.SocketServer          : {"op":"volume","guildId":"826863331474145361","volume":100}
2024-03-29 06:00:45.490  INFO 1244651 --- [   XNIO-1 I/O-2] lavalink.server.io.SocketServer          : {"op":"play","track":"QAAAjAIAKUrDoSBxdWUgbWUgZW5zaW5vdSBhIGJlYmVyIE11ZmZsZWQgMSBob3JhAAlFc3RhUm9zY2EAAAAAADfogAALMmdGX1pJQmlLT3cAAQAraHR0cHM6Ly93d3cueW91dHViZS5jb20vd2F0Y2g/dj0yZ0ZfWklCaUtPdwAHeW91dHViZQAAAAAAAAAA","guildId":"[censored]"}
2024-03-29 06:00:46.173  INFO 1244651 --- [   XNIO-1 I/O-2] lavalink.server.io.SocketServer          : {"op":"destroy","guildId":"[censored]"}
  1. Spotify also has a playing issue. 3.1 bot joins the channel 3.2 shows the error message: :x: Couldn't find what you were looking for :( 3.3 bot leaves the channel

    The output from lavalink server for Spotify: (i have added client id and secret to .env, bot is in development mode, APIs used are Web API and Web Playback SDK)

    
    2024-03-29 05:37:41.241  INFO 1237240 --- [  XNIO-1 task-1] l.server.player.AudioLoaderRestHandler   : Got request to load for identifier "https://open.spotify.com/episode/5ZnTuT7DhPKVW8m2tkcOik?si=11de7ff2a24e4dda"
    2024-03-29 05:37:41.570 ERROR 1237240 --- [ader-2-thread-1] lavalink.server.player.AudioLoader       : Load failed

com.sedmelluq.discord.lavaplayer.tools.FriendlyException: Unknown file format. at com.sedmelluq.discord.lavaplayer.source.ProbingAudioSourceManager.handleLoadResult(ProbingAudioSourceManager.java:35) ~[lavaplayer-1.5.3.jar!/:na] at com.sedmelluq.discord.lavaplayer.source.http.HttpAudioSourceManager.loadItem(HttpAudioSourceManager.java:73) ~[lavaplayer-1.5.3.jar!/:na] at com.sedmelluq.discord.lavaplayer.player.DefaultAudioPlayerManager.checkSourcesForItemOnce(DefaultAudioPlayerManager.java:406) ~[lavaplayer-1.5.3.jar!/:na] at com.sedmelluq.discord.lavaplayer.player.DefaultAudioPlayerManager.checkSourcesForItem(DefaultAudioPlayerManager.java:388) ~[lavaplayer-1.5.3.jar!/:na] at com.sedmelluq.discord.lavaplayer.player.DefaultAudioPlayerManager.lambda$createItemLoader$0(DefaultAudioPlayerManager.java:183) ~[lavaplayer-1.5.3.jar!/:na] at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[na:na] at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[na:na] at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[na:na] at java.base/java.lang.Thread.run(Thread.java:830) ~[na:na] Suppressed: com.sedmelluq.discord.lavaplayer.tools.exception.EnvironmentInformation: lavaplayer.version: 1.5.3 os.arch: amd64 os.name: Linux os.version: 4.18.0-513.11.1.el8_9.x86_64 java.vendor: Azul Systems, Inc. java.version: 13.0.14 java.runtime.version: 13.0.14+5-MTS java.vm.version: 13.0.14+5-MTS


4. SoundCloud reproduction is fine, there are no issues whatsoever.

5. Depending on the query sometimes I will receive this error:

    ![image](https://github.com/galnir/Master-Bot/assets/3647085/2f0ae3a3-e391-479e-910b-9183d42b4122)

And the prompt will show 

@master-bot/bot:dev: Client Listener TRPCClientError: Unexpected token '<', "<!DOCTYPE "... is not valid JSON @master-bot/bot:dev: Client Listener TRPCClientError: Unexpected token '<', "<!DOCTYPE "... is not valid JSON @master-bot/bot:dev: Client Listener TRPCClientError: Unexpected token '<', "<!DOCTYPE "... is not valid JSON

Bacon-Fixation commented 8 months ago

Howdy @barateza,

my apologise for delayed response, seems that youtube calls using LavaLink V3.x are not working currently, I am looking into updating to Lavalink v4 since it's been released, and currently the lavalink-client module in the package.json doesn't support LavaLink V4 yet.

it may take some time before a fix is released, as it could possibly be an extensive update to get youtube/spotify links usable again

Much Love -Bacon