mirror of
https://github.com/RYGhub/royalnet.git
synced 2024-11-24 03:54: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)
|
random.shuffle(self.list)
|
||||||
|
|
||||||
def clear(self):
|
def clear(self):
|
||||||
self.list = None
|
self.list = []
|
||||||
|
|
||||||
def find_video(self, name: str) -> typing.Optional[Video]:
|
def find_video(self, name: str) -> typing.Optional[Video]:
|
||||||
"""Returns the first video with a certain name."""
|
"""Returns the first video with a certain name."""
|
||||||
|
@ -711,17 +711,15 @@ class RoyalDiscordBot(discord.Client):
|
||||||
continue
|
continue
|
||||||
if voice_client.is_paused():
|
if voice_client.is_paused():
|
||||||
continue
|
continue
|
||||||
|
# Ensure the next video is ready
|
||||||
|
if self.video_queue.next_video().is_ready:
|
||||||
|
continue
|
||||||
# Advance the queue
|
# Advance the queue
|
||||||
self.video_queue.advance_queue()
|
self.video_queue.advance_queue()
|
||||||
# Try to generate an AudioSource
|
# Try to generate an AudioSource
|
||||||
if self.video_queue.now_playing is None:
|
if self.video_queue.now_playing is None:
|
||||||
continue
|
continue
|
||||||
while True:
|
|
||||||
try:
|
|
||||||
audio_source = self.video_queue.now_playing.make_audio_source()
|
audio_source = self.video_queue.now_playing.make_audio_source()
|
||||||
break
|
|
||||||
except errors.VideoIsNotReady:
|
|
||||||
await asyncio.sleep(1)
|
|
||||||
# Start playing the AudioSource
|
# Start playing the AudioSource
|
||||||
logger.info(f"Started playing {self.video_queue.now_playing.plain_text()}.")
|
logger.info(f"Started playing {self.video_queue.now_playing.plain_text()}.")
|
||||||
voice_client.play(audio_source)
|
voice_client.play(audio_source)
|
||||||
|
|
Loading…
Reference in a new issue