Fix bug where bot disconnects from voice channel before finishing the audio sequence.

This commit is contained in:
Edgar P. Burkhart 2024-09-19 20:29:41 +02:00
parent db695b0805
commit 5c77a47383
Signed by: edpibu
GPG key ID: 9833D3C5A25BD227

View file

@ -11,7 +11,7 @@ from .ai import AIBot
description = """BotBotBot""" description = """BotBotBot"""
logger = logging.getLogger("botbotbot") logger = logging.getLogger("botbotbot")
logging.basicConfig(level=logging.DEBUG) logging.basicConfig(level=logging.INFO)
with open("config.toml", "rb") as config_file: with open("config.toml", "rb") as config_file:
config = tomllib.load(config_file) config = tomllib.load(config_file)
@ -234,7 +234,7 @@ async def voice_random_nicks(member, before, after):
vo = await after.channel.connect() vo = await after.channel.connect()
await asyncio.sleep(random.randrange(10)) await asyncio.sleep(random.randrange(10))
vo.play(source) await vo.play(source, wait_finish=True)
await asyncio.sleep(random.randrange(60)) await asyncio.sleep(random.randrange(60))
await vo.disconnect() await vo.disconnect()