From c82dc32ca26e449079c92878c0951b6507bc758e Mon Sep 17 00:00:00 2001 From: Rich Oberholtzer Date: Fri, 19 Jun 2020 11:42:37 -0400 Subject: [PATCH] changing play delay to check if file is still being played --- r0b3bot.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/r0b3bot.py b/r0b3bot.py index 654604a..6245f62 100644 --- a/r0b3bot.py +++ b/r0b3bot.py @@ -287,7 +287,9 @@ async def play_sound(ctx, member : discord.Member, soundFile, command, playtime) print(f" - Playing {soundFile}") time.sleep(1) voice.play(audio_source, after=None) - time.sleep(playtime) + while voice.is_playing(): + await asyncio.sleep(1) + #time.sleep(playtime) print(f" - Disconnecting from '{channel}'") await voice.disconnect() ### -- 2.39.5