mirror of
https://github.com/arthur-pbty/shadowbot.git
synced 2026-06-07 23:04:54 +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,59 @@
|
||||
use serenity::model::prelude::*;
|
||||
use serenity::prelude::*;
|
||||
|
||||
use crate::commands::{advanced_tools, help, mp, perms_service, suggestion, tempvoc, ticket};
|
||||
|
||||
pub async fn handle_interaction_create(ctx: &Context, interaction: &Interaction) {
|
||||
if let Interaction::Command(_) = interaction {
|
||||
if help::handle_slash_interaction(ctx, interaction).await {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if let Interaction::Component(component) = interaction {
|
||||
if ticket::handle_component_interaction(ctx, component).await {
|
||||
return;
|
||||
}
|
||||
|
||||
if suggestion::handle_component_interaction(ctx, component).await {
|
||||
return;
|
||||
}
|
||||
|
||||
if tempvoc::handle_component_interaction(ctx, component).await {
|
||||
return;
|
||||
}
|
||||
|
||||
if help::handle_help_component(ctx, component).await {
|
||||
return;
|
||||
}
|
||||
|
||||
if mp::handle_mp_component(ctx, component).await {
|
||||
return;
|
||||
}
|
||||
|
||||
if perms_service::handle_allperms_component(ctx, component).await {
|
||||
return;
|
||||
}
|
||||
|
||||
let _ = advanced_tools::handle_component_interaction(ctx, component).await;
|
||||
return;
|
||||
}
|
||||
|
||||
if let Interaction::Modal(modal) = interaction {
|
||||
if ticket::handle_modal_interaction(ctx, modal).await {
|
||||
return;
|
||||
}
|
||||
|
||||
if suggestion::handle_modal_interaction(ctx, modal).await {
|
||||
return;
|
||||
}
|
||||
|
||||
if tempvoc::handle_modal_interaction(ctx, modal).await {
|
||||
return;
|
||||
}
|
||||
|
||||
let _ = advanced_tools::handle_modal_interaction(ctx, modal).await;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user