Files
shadowbot/src/events/voice_state_update_event.rs
T
Puechberty Arthur 3e69185296 feat(events): add message update, role, and voice state update handlers
- Implemented `handle_message_update` to log message edits.
- Created role event handlers for role creation, update, and deletion.
- Added voice state update handling to log channel changes.
- Introduced a new `ready_event` handler to restore bot presence and enforce blacklist.
- Updated `mod.rs` to include new event modules.
- Enhanced `main.rs` for database connection and initialization.
- Added comprehensive permission management in `permissions.rs`.
2026-04-10 02:13:04 +02:00

22 lines
613 B
Rust

use serenity::model::prelude::*;
use serenity::prelude::*;
use crate::commands::logs_service;
use crate::commands::tempvoc;
pub async fn handle_voice_state_update(ctx: &Context, old: Option<VoiceState>, new: &VoiceState) {
tempvoc::handle_voice_state_update(ctx, old.as_ref(), new).await;
let Some(guild_id) = new.guild_id else {
return;
};
let old_channel = old.and_then(|v| v.channel_id);
let new_channel = new.channel_id;
if old_channel == new_channel {
return;
}
logs_service::on_voice_update(ctx, guild_id, new.user_id, old_channel, new_channel).await;
}