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:
Puechberty Arthur
2026-04-10 02:13:04 +02:00
commit 3e69185296
169 changed files with 23909 additions and 0 deletions
+21
View File
@@ -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;
}