From 5c77a47383b9374b058ce74c5dcf5f3263a929ad Mon Sep 17 00:00:00 2001 From: "Edgar P. Burkhart" Date: Thu, 19 Sep 2024 20:29:41 +0200 Subject: [PATCH] Fix bug where bot disconnects from voice channel before finishing the audio sequence. --- botbotbot/__main__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/botbotbot/__main__.py b/botbotbot/__main__.py index 25b313b..511d9f9 100644 --- a/botbotbot/__main__.py +++ b/botbotbot/__main__.py @@ -11,7 +11,7 @@ from .ai import AIBot description = """BotBotBot""" logger = logging.getLogger("botbotbot") -logging.basicConfig(level=logging.DEBUG) +logging.basicConfig(level=logging.INFO) with open("config.toml", "rb") as config_file: config = tomllib.load(config_file) @@ -234,7 +234,7 @@ async def voice_random_nicks(member, before, after): vo = await after.channel.connect() await asyncio.sleep(random.randrange(10)) - vo.play(source) + await vo.play(source, wait_finish=True) await asyncio.sleep(random.randrange(60)) await vo.disconnect()