From 4663f260b55de0975661fda1c00f60d2ca6e4506 Mon Sep 17 00:00:00 2001 From: salmonik Date: Wed, 20 May 2026 15:40:18 +0200 Subject: Clean up consumers: replace polling with VoiceManager.play_source() - cron.py: replace while-is_playing polling with VoiceManager.play_source() - vclogs.py: replace while-is_playing polling with VoiceManager.play_source() - stop.py: use VoiceManager.disconnect() instead of raw voice_client - join.py: use VoiceManager.connect() instead of raw channel.connect() - voice.py: add back join_by_channel_id() convenience method - Tests: update for new VoiceManager method names and signatures --- cogs/vclogs.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'cogs/vclogs.py') diff --git a/cogs/vclogs.py b/cogs/vclogs.py index b538265..2e853ad 100644 --- a/cogs/vclogs.py +++ b/cogs/vclogs.py @@ -160,12 +160,7 @@ class VcLogs(commands.Cog): logger.info("preparing to play audio") audio_source = discord.FFmpegPCMAudio(tts_file) - if volume != 1.0: - audio_source = discord.PCMVolumeTransformer(audio_source) - audio_source.volume = volume - voice_client.play(audio_source) - while voice_client.is_playing(): - await asyncio.sleep(0.1) + await voice_mgr.play_source(channel, audio_source, volume=volume) except Exception as e: logger.error(f"TTS playback error: {e}") finally: -- cgit v1.2.3