diff options
| author | salmonik <raisersoft@proton.me> | 2026-05-20 15:21:37 +0200 |
|---|---|---|
| committer | salmonik <raisersoft@proton.me> | 2026-05-20 15:21:37 +0200 |
| commit | 1f37a67c53233dc8e814d22620e1ff8a6fdb14b6 (patch) | |
| tree | 42062b7e90cda16bd25091ff9c31046d18b6029c /cogs/vclogs.py | |
| parent | proper context for settings (diff) | |
| download | senator-sperma-1f37a67c53233dc8e814d22620e1ff8a6fdb14b6.tar.gz senator-sperma-1f37a67c53233dc8e814d22620e1ff8a6fdb14b6.zip | |
health checks for vc
Signed-off-by: salmonik <raisersoft@proton.me>
Diffstat (limited to '')
| -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) |
