[Bug Report] channels registered with `setvc` do not respect the `alonetimeuntilstop` configuration
- Dominant language
- Java
- Stars
- 5.8k
- Forks
- 2.8k
- PR merge metrics
- No merged PRs in 30d
Description
### Bug Description
If a server has a Voice Channel configured with `setvc`, there is a playlist configured with `autoplaylist`, and there are not active users in the channel when the bot starts, the bot will remain permanently idle in that channel on startup despite the `alonetimeuntilstop` configuration.
### Steps to Reproduce
1. Set `alonetimeuntilstop = 5` in config.txt
2. `setvc General`
3. `autoplaylist myplaylist`
4. Make sure no users are in the General voice channel
5. Restart the bot
The bot joins General and does not leave after 5 seconds.
### Expected Result
The bot should either not join channels which have no active listeners, or disconnect after `alonetimeuntilstop` as usual.
### 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 = false
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 = 25
Discord Information:
ID = 925614830528888834
Guilds = 3
Users = 2
```
### Additional Info
_No response_
### Checklist
- [X] I have looked for information about this [within the documentation](https://jmusicbot.com/)
- [X] I have searched for similar issues [on the issues page](https://github.com/jagrosh/MusicBot/issues?q=is%3Aissue)
- [X] I am running the latest version of the bot: 
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by tracing startup handling for the `setvc` and `autoplaylist` commands, then follow where `alonetimeuntilstop` is applied when the bot joins a voice channel. Reproduce the listed no-listener scenario and verify that startup either avoids the join or disconnects after five seconds.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100