freyacodes / archived-bot

A Discord music bot serving music in over 3 million discord servers
https://fredboat.com/docs
MIT License
487 stars 210 forks source link

Bot doesn't leave when left alone #605

Open anton-johansson opened 4 years ago

anton-johansson commented 4 years ago

I've just hosted FredBoat myself using Kubernetes, which works great. However, if the bot is left alone, it doesn't leave the channel. It just stops playing and prints this:

Left channel <channel-name>.

Whenever I want to come back and play something, it's stuck in some weird state. I have to force it to leave with !leave before I can play anything. So it would be great if I could have the bot leave automatically when left alone instead, as this would solve my issue.

Is there any way to force it to leave when left alone?

freyacodes commented 4 years ago

Sorry for the late reply.

Some users prefer having the bot remain connected. The large public FredBoat closes any unused voice connections for performance reasons.

I would be more concerned about the fact that your bot is left in a broken state. Is it a concern of yours that the bot remains in the channel?

anton-johansson commented 4 years ago

No worries! The workaround is to simply !leave and then re-queue stuff. :)

Yeah, you're right. The main issue is that it ends up in this state. I think this can happen even though people don't leave the channel. If you simply leave the bot in a non-playing state for too long, it will just stop working.

Is there any specific logs you want to take a look at when this happens?

freyacodes commented 4 years ago

I don't think logs will help, but I should be able to reproduce this locally.

29988122 commented 4 years ago

This issue is still there as far as I tested.

At first I thought it's my problem, but it seems that it's not after I crontab to auto-update fredboat

0 0 * * * cd /home/a29988122/Documents/P_FredBoat/config/ && sudo /usr/local/bin/docker-compose down >/dev/null 2>&1
10 0 * * * cd /home/a29988122/Documents/P_FredBoat/config/ && sudo /usr/local/bin/docker-compose up --force-recreate --build -d >/dev/null 2>&1

I think I've encountered the same issue as @anton-johansson My friends don't know how to !leave and !play by them, so I'd like this issue to be solved so Fredboat won't be muted after certain amount of uptime. (or just add another option in config files to make docker version of fredboat capable to adjust autodisconnect from voice channel - it will rejoin itself after !play has been issued, anyway.)

Thank you!