mirror of
https://github.com/arthur-pbty/shadowbot.git
synced 2026-06-05 22:01:47 +02:00
3e69185296
- 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`.
22 lines
613 B
Rust
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;
|
|
}
|