diff options
| author | salmonik <salmonik@tuta.io> | 2026-09-09 14:36:50 +0200 |
|---|---|---|
| committer | salmonik <salmonik@tuta.io> | 2026-09-09 14:36:50 +0200 |
| commit | 0d1fdab3a10b30d83da50b7f20acc18b7a350a22 (patch) | |
| tree | 2c463b26add0a50bd7150c7eeee665d315a988d2 /src/events | |
| parent | first draft (diff) | |
| download | senator-sperma-0d1fdab3a10b30d83da50b7f20acc18b7a350a22.tar.gz senator-sperma-0d1fdab3a10b30d83da50b7f20acc18b7a350a22.zip | |
wire recording into voice manager, config, events, /record command
Diffstat (limited to '')
| -rw-r--r-- | src/events/mod.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/events/mod.rs b/src/events/mod.rs index 1c8c0dc..5006444 100644 --- a/src/events/mod.rs +++ b/src/events/mod.rs | |||
| @@ -71,6 +71,20 @@ pub async fn handle_voice_state_update( | |||
| 71 | let user_id = new.user_id; | 71 | let user_id = new.user_id; |
| 72 | let guild_id = new.guild_id; | 72 | let guild_id = new.guild_id; |
| 73 | 73 | ||
| 74 | // The bot's own voice state drives the recording lifecycle (catches admin | ||
| 75 | // moves, kicks, and gateway drops that VoiceManager::connect/disconnect | ||
| 76 | // can't see). Must run before the generic bot-skip below. | ||
| 77 | if user_id == ctx.cache.current_user().id { | ||
| 78 | crate::recording::on_bot_voice_state( | ||
| 79 | &data.voice_manager, | ||
| 80 | guild_id, | ||
| 81 | old.as_ref().and_then(|v| v.channel_id), | ||
| 82 | new.channel_id, | ||
| 83 | ) | ||
| 84 | .await; | ||
| 85 | return Ok(()); | ||
| 86 | } | ||
| 87 | |||
| 74 | // skip bots (Python behavior) | 88 | // skip bots (Python behavior) |
| 75 | let member = guild_id | 89 | let member = guild_id |
| 76 | .and_then(|gid| ctx.cache.guild(gid)) | 90 | .and_then(|gid| ctx.cache.guild(gid)) |
