updated structure

This commit is contained in:
bacon
2024-03-17 22:03:27 +03:00
parent 4e535f6580
commit d22c3ca6b6
44 changed files with 955 additions and 948 deletions

17
bot/lib/Player.py Normal file
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()