diff options
Diffstat (limited to 'cogs/music/audio_playback.py')
| -rw-r--r-- | cogs/music/audio_playback.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/cogs/music/audio_playback.py b/cogs/music/audio_playback.py index d23809a..5632728 100644 --- a/cogs/music/audio_playback.py +++ b/cogs/music/audio_playback.py | |||
| @@ -54,8 +54,10 @@ class AudioPlaybackManager: | |||
| 54 | async def connect_to_voice_channel(ctx, vc, target_channel): | 54 | async def connect_to_voice_channel(ctx, vc, target_channel): |
| 55 | """Connect or move to voice channel. Returns voice client.""" | 55 | """Connect or move to voice channel. Returns voice client.""" |
| 56 | try: | 56 | try: |
| 57 | # Check if vc is valid and actually connected | ||
| 58 | is_connected = vc is not None and vc.is_connected() | ||
| 57 | # Connect to voice channel if not connected | 59 | # Connect to voice channel if not connected |
| 58 | if vc is None: | 60 | if not is_connected: |
| 59 | logger.info(f"Connecting to voice channel: {target_channel.name}") | 61 | logger.info(f"Connecting to voice channel: {target_channel.name}") |
| 60 | vc = await target_channel.connect() | 62 | vc = await target_channel.connect() |
| 61 | logger.info(f"Connected to voice channel: {target_channel.name}") | 63 | logger.info(f"Connected to voice channel: {target_channel.name}") |
