diff options
| author | salmonik <raisersoft@proton.me> | 2025-09-24 11:18:16 +0200 |
|---|---|---|
| committer | salmonik <raisersoft@proton.me> | 2025-09-24 11:18:16 +0200 |
| commit | 77ce63b863989ce7dbef84752e2808a8e100bde7 (patch) | |
| tree | 0863353a2e45e4b9ab9daa344d00f658944be1e7 | |
| parent | fixed vclogs.py (diff) | |
| download | senator-sperma-77ce63b863989ce7dbef84752e2808a8e100bde7.tar.gz senator-sperma-77ce63b863989ce7dbef84752e2808a8e100bde7.zip | |
another vc fix
Diffstat (limited to '')
| -rw-r--r-- | cogs/vclogs.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/cogs/vclogs.py b/cogs/vclogs.py index 01297a6..7bf179c 100644 --- a/cogs/vclogs.py +++ b/cogs/vclogs.py | |||
| @@ -70,10 +70,14 @@ class VcLogs(commands.Cog): | |||
| 70 | 70 | ||
| 71 | # Connect to the voice channel if not already connected | 71 | # Connect to the voice channel if not already connected |
| 72 | voice_client = discord.utils.get(self.bot.voice_clients, guild=channel.guild) | 72 | voice_client = discord.utils.get(self.bot.voice_clients, guild=channel.guild) |
| 73 | if not isinstance(voice_client, discord.VoiceClient): | 73 | try: |
| 74 | voice_client = await channel.connect() | 74 | if not isinstance(voice_client, discord.VoiceClient): |
| 75 | elif voice_client.channel != channel: | 75 | voice_client = await channel.connect() |
| 76 | await voice_client.move_to(channel) | 76 | elif voice_client.channel != channel: |
| 77 | await voice_client.move_to(channel) | ||
| 78 | except discord.errors.ClientException as e: | ||
| 79 | if str(e) == "Not connected to voice.": | ||
| 80 | voice_client = await channel.connect() | ||
| 77 | 81 | ||
| 78 | # Play the TTS audio | 82 | # Play the TTS audio |
| 79 | if not voice_client.is_playing(): | 83 | if not voice_client.is_playing(): |
| @@ -143,4 +147,4 @@ class VcLogs(commands.Cog): | |||
| 143 | 147 | ||
| 144 | 148 | ||
| 145 | def setup(bot): | 149 | def setup(bot): |
| 146 | bot.add_cog(VcLogs(bot)) \ No newline at end of file | 150 | bot.add_cog(VcLogs(bot)) |
