<feed xmlns='http://www.w3.org/2005/Atom'>
<title>senator-sperma/cogs/voice.py, branch main</title>
<subtitle>Very big discord bot.
</subtitle>
<id>https://git.2137697.xyz/senator-sperma/atom?h=main</id>
<link rel='self' href='https://git.2137697.xyz/senator-sperma/atom?h=main'/>
<link rel='alternate' type='text/html' href='https://git.2137697.xyz/senator-sperma/'/>
<updated>2026-07-08T00:13:35Z</updated>
<entry>
<title>OPEN THE RUST GATES</title>
<updated>2026-07-08T00:13:35Z</updated>
<author>
<name>salmonik</name>
<email>raisersoft@proton.me</email>
</author>
<published>2026-07-08T00:13:35Z</published>
<link rel='alternate' type='text/html' href='https://git.2137697.xyz/senator-sperma/commit/?id=cd8ed8bc5793985df2c1692072a932ceee517b95'/>
<id>urn:sha1:cd8ed8bc5793985df2c1692072a932ceee517b95</id>
<content type='text'>
Signed-off-by: salmonik &lt;raisersoft@proton.me&gt;
</content>
</entry>
<entry>
<title>Fix voice reconnect race: reuse VoiceClient instead of destroying it</title>
<updated>2026-05-21T14:45:31Z</updated>
<author>
<name>salmonik</name>
<email>raisersoft@proton.me</email>
</author>
<published>2026-05-21T14:45:31Z</published>
<link rel='alternate' type='text/html' href='https://git.2137697.xyz/senator-sperma/commit/?id=35545e30303faa517a98ec18c660e5f6c063c912'/>
<id>urn:sha1:35545e30303faa517a98ec18c660e5f6c063c912</id>
<content type='text'>
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.
</content>
</entry>
<entry>
<title>Fix stale-connection reconnect hang and TTS temp-file collision</title>
<updated>2026-05-20T15:08:40Z</updated>
<author>
<name>salmonik</name>
<email>raisersoft@proton.me</email>
</author>
<published>2026-05-20T15:08:40Z</published>
<link rel='alternate' type='text/html' href='https://git.2137697.xyz/senator-sperma/commit/?id=8d35930871db37b1009275c423ce95ed72954613'/>
<id>urn:sha1:8d35930871db37b1009275c423ce95ed72954613</id>
<content type='text'>
- _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
</content>
</entry>
<entry>
<title>Clean up consumers: replace polling with VoiceManager.play_source()</title>
<updated>2026-05-20T13:40:18Z</updated>
<author>
<name>salmonik</name>
<email>raisersoft@proton.me</email>
</author>
<published>2026-05-20T13:40:18Z</published>
<link rel='alternate' type='text/html' href='https://git.2137697.xyz/senator-sperma/commit/?id=4663f260b55de0975661fda1c00f60d2ca6e4506'/>
<id>urn:sha1:4663f260b55de0975661fda1c00f60d2ca6e4506</id>
<content type='text'>
- 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
</content>
</entry>
<entry>
<title>Fold AudioPlaybackManager into VoiceManager + Future-based play</title>
<updated>2026-05-20T13:36:17Z</updated>
<author>
<name>salmonik</name>
<email>raisersoft@proton.me</email>
</author>
<published>2026-05-20T13:36:17Z</published>
<link rel='alternate' type='text/html' href='https://git.2137697.xyz/senator-sperma/commit/?id=fbdfad855ab9a1233e286806439397729ba21226'/>
<id>urn:sha1:fbdfad855ab9a1233e286806439397729ba21226</id>
<content type='text'>
- 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
</content>
</entry>
<entry>
<title>health checks for vc</title>
<updated>2026-05-20T13:21:37Z</updated>
<author>
<name>salmonik</name>
<email>raisersoft@proton.me</email>
</author>
<published>2026-05-20T13:21:37Z</published>
<link rel='alternate' type='text/html' href='https://git.2137697.xyz/senator-sperma/commit/?id=1f37a67c53233dc8e814d22620e1ff8a6fdb14b6'/>
<id>urn:sha1:1f37a67c53233dc8e814d22620e1ff8a6fdb14b6</id>
<content type='text'>
Signed-off-by: salmonik &lt;raisersoft@proton.me&gt;
</content>
</entry>
<entry>
<title>multitude of changes.</title>
<updated>2026-04-28T18:05:36Z</updated>
<author>
<name>salmonik</name>
<email>raisersoft@proton.me</email>
</author>
<published>2026-04-28T18:05:36Z</published>
<link rel='alternate' type='text/html' href='https://git.2137697.xyz/senator-sperma/commit/?id=5675dfd20b24f1e0eef06b11d9ec41a894d3a5bf'/>
<id>urn:sha1:5675dfd20b24f1e0eef06b11d9ec41a894d3a5bf</id>
<content type='text'>
but primarly, use db for all data.

Signed-off-by: salmonik &lt;raisersoft@proton.me&gt;
</content>
</entry>
<entry>
<title>refactor: simplify cogs, reduce complexity</title>
<updated>2026-04-19T13:43:32Z</updated>
<author>
<name>salmonik</name>
<email>raisersoft@proton.me</email>
</author>
<published>2026-04-19T13:43:32Z</published>
<link rel='alternate' type='text/html' href='https://git.2137697.xyz/senator-sperma/commit/?id=1dcdbe3cf03ff16b3ff2e2e6d572e0b3c72c18c0'/>
<id>urn:sha1:1dcdbe3cf03ff16b3ff2e2e6d572e0b3c72c18c0</id>
<content type='text'>
- Remove unused imports and dead code
- Cleaner error handling
- Reduce cognitive complexity
</content>
</entry>
<entry>
<title>refactor + preparing bot for public use</title>
<updated>2026-04-17T22:24:50Z</updated>
<author>
<name>salmonik</name>
<email>raisersoft@proton.me</email>
</author>
<published>2026-04-17T22:24:50Z</published>
<link rel='alternate' type='text/html' href='https://git.2137697.xyz/senator-sperma/commit/?id=a2b5b10625126b7e98643af9fe40569c9e004047'/>
<id>urn:sha1:a2b5b10625126b7e98643af9fe40569c9e004047</id>
<content type='text'>
Signed-off-by: salmonik &lt;raisersoft@proton.me&gt;
</content>
</entry>
<entry>
<title>fix voice even more</title>
<updated>2026-04-17T17:40:58Z</updated>
<author>
<name>salmonik</name>
<email>raisersoft@proton.me</email>
</author>
<published>2026-04-17T17:40:58Z</published>
<link rel='alternate' type='text/html' href='https://git.2137697.xyz/senator-sperma/commit/?id=a57487e45077114f30404d944772e7dd56a935a0'/>
<id>urn:sha1:a57487e45077114f30404d944772e7dd56a935a0</id>
<content type='text'>
Signed-off-by: salmonik &lt;raisersoft@proton.me&gt;
</content>
</entry>
</feed>
