diff options
Diffstat (limited to 'cogs/vclogs.py')
| -rw-r--r-- | cogs/vclogs.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/cogs/vclogs.py b/cogs/vclogs.py index e5ca202..b538265 100644 --- a/cogs/vclogs.py +++ b/cogs/vclogs.py | |||
| @@ -129,6 +129,16 @@ class VcLogs(commands.Cog): | |||
| 129 | is_connected = voice_status[1] if voice_status else False | 129 | is_connected = voice_status[1] if voice_status else False |
| 130 | is_playing = voice_status[2] if voice_status else False | 130 | is_playing = voice_status[2] if voice_status else False |
| 131 | 131 | ||
| 132 | if is_connected and not is_playing: | ||
| 133 | from cogs.voice import is_voice_client_alive | ||
| 134 | if not is_voice_client_alive(voice_client, channel.guild): | ||
| 135 | logger.warning("Stale voice client in play_tts, reconnecting") | ||
| 136 | try: | ||
| 137 | await voice_client.disconnect() | ||
| 138 | except Exception: | ||
| 139 | pass | ||
| 140 | is_connected = False | ||
| 141 | |||
| 132 | if not is_connected: | 142 | if not is_connected: |
| 133 | voice_client = await voice_mgr.join_channel(channel) | 143 | voice_client = await voice_mgr.join_channel(channel) |
| 134 | voice_status = await voice_mgr.get_voice_status(channel.guild) | 144 | voice_status = await voice_mgr.get_voice_status(channel.guild) |
