Merge pull request #259 from SeerLite/empty-playlist-message

Don't show how to resume if playlist is empty when "when_nobody_in_channel = pause"
This commit is contained in:
Terry Geng 2021-03-13 15:44:40 +08:00 committed by GitHub
commit df38c7dbd6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -353,11 +353,11 @@ class MumbleBot:
if len(own_channel.get_users()) == 2:
if var.config.get("bot", "when_nobody_in_channel") == "pause_resume":
self.resume()
elif var.config.get("bot", "when_nobody_in_channel") == "pause":
elif var.config.get("bot", "when_nobody_in_channel") == "pause" and self.is_pause:
self.send_channel_msg(tr("auto_paused"))
elif len(own_channel.get_users()) == 1:
# if the bot is the only user left in the channel
elif len(own_channel.get_users()) == 1 and len(var.playlist) != 0:
# if the bot is the only user left in the channel and the playlist isn't empty
self.log.info('bot: Other users in the channel left. Stopping music now.')
if var.config.get("bot", "when_nobody_in_channel") == "stop":