mirror of
https://github.com/arthur-pbty/shadowbot.git
synced 2026-06-03 23:36:25 +02:00
Refactor code for improved readability and consistency across various command files
- Adjusted formatting and indentation in `rename.rs`, `suggestion.rs`, `tempvoc.rs`, `ticket.rs`, `ticket_member.rs`, and `tickets.rs` for better clarity. - Consolidated `if` statements and method calls for cleaner code in `suggestion.rs`, `tempvoc.rs`, and `ticket.rs`. - Updated the `LOGS_PER_PAGE` constant in `viewlogs.rs` to increase the number of logs displayed per page. - Removed unused `handle_boostembed` function from `logs_service.rs`. - Added new modules in `mod.rs` for better organization of command files. - Enhanced the `handle_show_pics` function in `showpics.rs` for improved member filtering. - Updated the `handle_message` function in `message_event.rs` to streamline command handling.
This commit is contained in:
@@ -2,7 +2,8 @@ use serenity::model::prelude::*;
|
||||
use serenity::prelude::*;
|
||||
|
||||
use crate::commands::{
|
||||
advanced_tools, help, helpsetting, mp, perms_service, suggestion, tempvoc, ticket,
|
||||
advanced_tools, boostembed, help, helpsetting, mp, perms_service, suggestion, tempvoc,
|
||||
ticket,
|
||||
};
|
||||
|
||||
pub async fn handle_interaction_create(ctx: &Context, interaction: &Interaction) {
|
||||
@@ -21,6 +22,10 @@ pub async fn handle_interaction_create(ctx: &Context, interaction: &Interaction)
|
||||
return;
|
||||
}
|
||||
|
||||
if boostembed::handle_component_interaction(ctx, component).await {
|
||||
return;
|
||||
}
|
||||
|
||||
if tempvoc::handle_component_interaction(ctx, component).await {
|
||||
return;
|
||||
}
|
||||
@@ -54,6 +59,10 @@ pub async fn handle_interaction_create(ctx: &Context, interaction: &Interaction)
|
||||
return;
|
||||
}
|
||||
|
||||
if boostembed::handle_modal_interaction(ctx, modal).await {
|
||||
return;
|
||||
}
|
||||
|
||||
if tempvoc::handle_modal_interaction(ctx, modal).await {
|
||||
return;
|
||||
}
|
||||
@@ -61,5 +70,3 @@ pub async fn handle_interaction_create(ctx: &Context, interaction: &Interaction)
|
||||
let _ = advanced_tools::handle_modal_interaction(ctx, modal).await;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user