Skip to content

Commit

Permalink
Merge branch 'inactive-player-timeout'
Browse files Browse the repository at this point in the history
  • Loading branch information
itsTheFae committed Dec 9, 2023
2 parents cd9a7c3 + 2d3ff4e commit 481fc2d
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions musicbot/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -859,14 +859,19 @@ async def update_now_playing_status(self):
if not self.config.status_message:
entry = None
paused = False
activeplayers = sum(1 for p in self.players.values() if p.is_playing)
if activeplayers > 1:
activeplayers = [p for p in self.players.values() if p.is_playing]
if len(activeplayers) > 1:
game = discord.Game(
type=0, name="music on %s guilds" % activeplayers
)

elif activeplayers == 1:
player = discord.utils.get(self.players.values(), is_playing=True)
elif len(activeplayers) == 1:
player = activeplayers[0]
paused = player.is_paused
entry = player.current_entry

elif len(self.players):
player = list(self.players.values())[0]
paused = player.is_paused
entry = player.current_entry

Expand Down

0 comments on commit 481fc2d

Please sign in to comment.