aboutsummaryrefslogtreecommitdiffstats
path: root/cogs/voice.py (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Fix voice reconnect race: reuse VoiceClient instead of destroying itsalmonik2026-05-211-11/+43
| | | | | | | | | | | | | | | The stale-connection path was calling _remove_voice_client() then creating a brand-new VoiceClient via channel.connect(). This created a race: VOICE_SERVER_UPDATE (triggered by Discord when the user joins voice) arrives between the destroy and the fresh-connect, gets consumed by the old client, and the new client never receives it — causing a 10s timeout waiting for got_both_voice_updates. Fix: after disconnect(), call vc.connect() on the same VoiceClient instance. The disconnect resets the state machine to 'disconnected' but the same VoiceConnectionState processes any events that arrive between disconnect and reconnect, so the state machine correctly reaches got_both_voice_updates.
* Fix stale-connection reconnect hang and TTS temp-file collisionsalmonik2026-05-201-4/+26
| | | | | | | | | | - _ensure_voice_client: call _remove_voice_client() when cleaning up stale or disconnected clients so the fresh connect doesn't hang for 30s waiting for Discord's stale state to clear - Reduce connect timeout from 30s to 10s for faster failure recovery - vclogs.py: use a unique temp filename per TTS call (include timestamp) instead of relying on PID alone, preventing concurrent TTS calls from clobbering each other's files
* Clean up consumers: replace polling with VoiceManager.play_source()salmonik2026-05-201-0/+11
| | | | | | | | | - 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
* Fold AudioPlaybackManager into VoiceManager + Future-based playsalmonik2026-05-201-153/+254
| | | | | | | | | | | | - Move all static helpers (validate_voice_channel, prepare_source, prepare_audio_source, etc.) from AudioPlaybackManager into VoiceManager - Add _play_await() using asyncio.Future + after callback, replacing all polling patterns and the 5-second sleep hack - Add play() high-level method and play_source() for pre-made sources - Unify connection logic under single _ensure_voice_client() - Remove dead Voice cog class and its setup() - Gut audio_playback.py to a re-export shim - Remove cogs.voice from main.py extensions
* health checks for vcsalmonik2026-05-201-33/+89
| | | | Signed-off-by: salmonik <raisersoft@proton.me>
* multitude of changes.salmonik2026-04-281-0/+22
| | | | | | but primarly, use db for all data. Signed-off-by: salmonik <raisersoft@proton.me>
* refactor: simplify cogs, reduce complexitysalmonik2026-04-191-2/+2
| | | | | | - Remove unused imports and dead code - Cleaner error handling - Reduce cognitive complexity
* refactor + preparing bot for public usesalmonik2026-04-181-15/+24
| | | | Signed-off-by: salmonik <raisersoft@proton.me>
* fix voice even moresalmonik2026-04-171-5/+8
| | | | Signed-off-by: salmonik <raisersoft@proton.me>
* "fix" voice managementsalmonik2026-04-081-0/+15
|
* voice doesn't work due to DAVE, but we got copyparty searchsalmonik2026-03-181-29/+111
|
* more asynchronous work and other minor improvementssalmonik2026-02-041-26/+52
|
* add copyright and license noticesalmonik2026-01-261-0/+5
|
* bumped requirementssalmonik2026-01-031-0/+60