diff options
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)) |
