mirror of
https://github.com/RYGhub/royalnet.git
synced 2024-11-27 13:34:28 +00:00
hope nothing breaks
This commit is contained in:
parent
73073ad858
commit
9c2248402b
1 changed files with 7 additions and 1 deletions
|
@ -738,6 +738,11 @@ class RoyalDiscordBot(discord.Client):
|
||||||
del self.video_queue.list[index]
|
del self.video_queue.list[index]
|
||||||
continue
|
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):
|
async def queue_play_next_video(self):
|
||||||
await self.wait_until_ready()
|
await self.wait_until_ready()
|
||||||
while True:
|
while True:
|
||||||
|
@ -750,6 +755,8 @@ class RoyalDiscordBot(discord.Client):
|
||||||
continue
|
continue
|
||||||
if voice_client.is_paused():
|
if voice_client.is_paused():
|
||||||
continue
|
continue
|
||||||
|
# Clear the now playing video
|
||||||
|
await self.clear_now_playing()
|
||||||
# Ensure the next video is ready
|
# Ensure the next video is ready
|
||||||
next_video = self.video_queue.next_video()
|
next_video = self.video_queue.next_video()
|
||||||
if next_video is None or not next_video.is_ready:
|
if next_video is None or not next_video.is_ready:
|
||||||
|
@ -805,7 +812,6 @@ class RoyalDiscordBot(discord.Client):
|
||||||
try:
|
try:
|
||||||
logger.info("Disconnecting due to inactivity.")
|
logger.info("Disconnecting due to inactivity.")
|
||||||
await voice_client.disconnect()
|
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à.")
|
await self.main_channel.send("💤 Mi sono disconnesso dalla cv per inattività.")
|
||||||
except Exception:
|
except Exception:
|
||||||
raise Exception("Ciao! Sono un errore intenzionale di Steffo per testare il countdown inattività!")
|
raise Exception("Ciao! Sono un errore intenzionale di Steffo per testare il countdown inattività!")
|
||||||
|
|
Loading…
Reference in a new issue