mirror of
https://github.com/arthur-pbty/shadowbot.git
synced 2026-06-18 13:56:18 +02:00
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`.
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
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;
|
||||
}
|
||||
Reference in New Issue
Block a user