mirror of
https://github.com/RYGhub/royalnet.git
synced 2024-11-23 19:44:20 +00:00
Possible bugfix
This commit is contained in:
parent
30b79ff807
commit
f56d8a13d5
1 changed files with 5 additions and 7 deletions
|
@ -318,7 +318,7 @@ class VideoQueue:
|
|||
random.shuffle(self.list)
|
||||
|
||||
def clear(self):
|
||||
self.list = None
|
||||
self.list = []
|
||||
|
||||
def find_video(self, name: str) -> typing.Optional[Video]:
|
||||
"""Returns the first video with a certain name."""
|
||||
|
@ -711,17 +711,15 @@ class RoyalDiscordBot(discord.Client):
|
|||
continue
|
||||
if voice_client.is_paused():
|
||||
continue
|
||||
# Ensure the next video is ready
|
||||
if self.video_queue.next_video().is_ready:
|
||||
continue
|
||||
# Advance the queue
|
||||
self.video_queue.advance_queue()
|
||||
# Try to generate an AudioSource
|
||||
if self.video_queue.now_playing is None:
|
||||
continue
|
||||
while True:
|
||||
try:
|
||||
audio_source = self.video_queue.now_playing.make_audio_source()
|
||||
break
|
||||
except errors.VideoIsNotReady:
|
||||
await asyncio.sleep(1)
|
||||
# Start playing the AudioSource
|
||||
logger.info(f"Started playing {self.video_queue.now_playing.plain_text()}.")
|
||||
voice_client.play(audio_source)
|
||||
|
|
Loading…
Reference in a new issue