1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-23 19:44:20 +00:00

hope nothing breaks

This commit is contained in:
Steffo 2019-02-28 18:03:31 +01:00
parent 73073ad858
commit 9c2248402b

View file

@ -738,6 +738,11 @@ class RoyalDiscordBot(discord.Client):
del self.video_queue.list[index]
continue
async def clear_now_playing(self):
if self.video_queue.now_playing is not None:
self.video_queue.now_playing = None
await self.change_presence(status=discord.Status.online, activity=None)
async def queue_play_next_video(self):
await self.wait_until_ready()
while True:
@ -750,6 +755,8 @@ class RoyalDiscordBot(discord.Client):
continue
if voice_client.is_paused():
continue
# Clear the now playing video
await self.clear_now_playing()
# Ensure the next video is ready
next_video = self.video_queue.next_video()
if next_video is None or not next_video.is_ready:
@ -805,7 +812,6 @@ class RoyalDiscordBot(discord.Client):
try:
logger.info("Disconnecting due to inactivity.")
await voice_client.disconnect()
await self.change_presence(status=discord.Status.online, activity=None)
await self.main_channel.send("💤 Mi sono disconnesso dalla cv per inattività.")
except Exception:
raise Exception("Ciao! Sono un errore intenzionale di Steffo per testare il countdown inattività!")