fixed start after move

This commit is contained in:
bacon
2024-03-18 01:49:40 +03:00
parent e1fc05dea2
commit fff1a5c0c7
16 changed files with 29 additions and 47 deletions

View File

@@ -0,0 +1,17 @@
from asyncio import sleep
from disnake import FFmpegOpusAudio
from .Logger import logger
async def play_audio(audio, bot, vc):
if not bot.voice_clients:
logger.error(f'Playing: {audio}')
vp = await vc.connect()
if not vp.is_playing():
vp.play(FFmpegOpusAudio(f'{audio}', ))
while vp.is_playing():
await sleep(0.5)
await sleep(1)
await vp.disconnect()