edditing code

This commit is contained in:
2022-08-22 21:50:15 +03:00
parent 89707a7e9a
commit 3e7a812fdc
5 changed files with 64 additions and 29 deletions

14
lib/Player.py Normal file
View File

@@ -0,0 +1,14 @@
from asyncio import sleep
from disnake import FFmpegPCMAudio
async def play_audio(audio, bot, vc):
if not bot.voice_clients:
await sleep(1)
vp = await vc.connect()
if not vp.is_playing():
vp.play(FFmpegPCMAudio(f'audio/{audio}'), after=None)
while vp.is_playing():
await sleep(0.5)
await sleep(1)
await vp.disconnect()