diff options
| author | salmonik <raisersoft@proton.me> | 2026-05-20 15:40:18 +0200 |
|---|---|---|
| committer | salmonik <raisersoft@proton.me> | 2026-05-20 15:40:18 +0200 |
| commit | 4663f260b55de0975661fda1c00f60d2ca6e4506 (patch) | |
| tree | b649850859595542f8e7916a5513e0840e911318 /cogs/music/join.py | |
| parent | Fix TTS and AI voice playback bugs (diff) | |
| download | senator-sperma-4663f260b55de0975661fda1c00f60d2ca6e4506.tar.gz senator-sperma-4663f260b55de0975661fda1c00f60d2ca6e4506.zip | |
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
Diffstat (limited to 'cogs/music/join.py')
| -rw-r--r-- | cogs/music/join.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/cogs/music/join.py b/cogs/music/join.py index c613b10..d68ca79 100644 --- a/cogs/music/join.py +++ b/cogs/music/join.py | |||
| @@ -6,6 +6,7 @@ | |||
| 6 | import logging | 6 | import logging |
| 7 | 7 | ||
| 8 | from discord.ext import commands | 8 | from discord.ext import commands |
| 9 | from cogs.voice import get_voice_manager | ||
| 9 | 10 | ||
| 10 | logger = logging.getLogger(__name__) | 11 | logger = logging.getLogger(__name__) |
| 11 | 12 | ||
| @@ -16,8 +17,9 @@ class Join(commands.Cog): | |||
| 16 | 17 | ||
| 17 | @commands.slash_command(name="join", description="dołącza do kanalu") | 18 | @commands.slash_command(name="join", description="dołącza do kanalu") |
| 18 | async def join(self, ctx): | 19 | async def join(self, ctx): |
| 20 | voice_mgr = get_voice_manager(self.bot) | ||
| 19 | channel = ctx.author.voice.channel | 21 | channel = ctx.author.voice.channel |
| 20 | await channel.connect() | 22 | await voice_mgr.connect(channel) |
| 21 | await ctx.respond(content="\u200b", ephemeral=True) | 23 | await ctx.respond(content="\u200b", ephemeral=True) |
| 22 | await ctx.interaction.delete_original_response() | 24 | await ctx.interaction.delete_original_response() |
| 23 | logger.info("Bot connected to voice channel") | 25 | logger.info("Bot connected to voice channel") |
