jagrosh / MusicBot

🎶 A Discord music bot that's easy to set up and run yourself!
https://jmusicbot.com
Apache License 2.0
5.36k stars 2.56k forks source link

[Bug Report] Autoplaylist does not work until something has been played #1526

Open Th3Gavst3r opened 7 months ago

Th3Gavst3r commented 7 months ago

Bug Description

When the bot first starts up, the default playlist will never start playing until there has been at least one item played in the server.

Steps to Reproduce

  1. Start the bot
  2. autoplaylist myplaylist
  3. play Bot joins VC, but nothing plays
  4. play xvFZjo5PgG0 After this first song ends, the autoplaylist begins.
  5. stop
  6. play Now the autoplaylist begins even when no song is specified

Expected Result

The bot should always start the default playlist, even immediately after startup.

Debug Output

System Properties:
  java.version = 16.0.2
  java.vm.name = Java HotSpot(TM) 64-Bit Server VM
  java.vm.specification.version = 16
  java.runtime.name = Java(TM) SE Runtime Environment
  java.runtime.version = 16.0.2+7-67
  java.specification.version = 16
  os.arch = amd64
  os.name = Windows 10

JMusicBot Information:
  Version = 0.4.0
  Owner = 139935188837728256
  Prefix = @mention
  AltPrefix = null
  MaxSeconds = 0
  NPImages = false
  SongInStatus = false
  StayInChannel = false
  UseEval = false
  UpdateAlerts = true

Dependency Information:
  JDA Version = 4.4.1_353
  JDA-Utilities Version = 3.0.5
  Lavaplayer Version = 727959e9f621fc457b3a5adafcfffb55fdeaa538-SNAPSHOT

Runtime Information:
  Total Memory = 80
  Used Memory = 49

Discord Information:
  ID = 925614830528888834
  Guilds = 3
  Users = 2

Additional Info

This seems to be a per-server issue. Playing a song in one server does not fix the autoplaylist feature in any other servers until they have also played at least one item.

Checklist

jagrosh commented 6 months ago

If you want the autoplaylist to begin immediately, you need to set a voice channel for it to connect to with the setvc command.

Th3Gavst3r commented 6 months ago

I did have the voice channel set, which is how the bot joins the chat when you run play with no arguments. I forgot to include that step in the reproduction instructions. Even after it joins the channel configured with setvc it still does not start the autoplaylist.

jagrosh commented 6 months ago

If you have the voice channel set (setvc) and an autoplaylist set (autoplaylist), the bot should join that voice channel and begin playing the playlist when you reboot the bot jar

Th3Gavst3r commented 6 months ago

Oh I see the different behavior with setvc enabled now. However, setvc is also unwanted behavior. When I start the bot, I want it to only start playing when a user requests music to begin. Having the bot join and immediately begin playing on startup is not a complete workaround, and disrupts servers which did not wish to begin music playback. I just want the autoplaylist to begin playing when a user runs play with no arguments.

Having the bot automatically join on startup also presents another bug: #1541