From 0d1fdab3a10b30d83da50b7f20acc18b7a350a22 Mon Sep 17 00:00:00 2001 From: salmonik Date: Wed, 9 Sep 2026 14:36:50 +0200 Subject: wire recording into voice manager, config, events, /record command --- src/events/mod.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/events') 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( let user_id = new.user_id; let guild_id = new.guild_id; + // The bot's own voice state drives the recording lifecycle (catches admin + // moves, kicks, and gateway drops that VoiceManager::connect/disconnect + // can't see). Must run before the generic bot-skip below. + if user_id == ctx.cache.current_user().id { + crate::recording::on_bot_voice_state( + &data.voice_manager, + guild_id, + old.as_ref().and_then(|v| v.channel_id), + new.channel_id, + ) + .await; + return Ok(()); + } + // skip bots (Python behavior) let member = guild_id .and_then(|gid| ctx.cache.guild(gid)) -- cgit v1.2.3