mirror of
https://github.com/arthur-pbty/shadowbot.git
synced 2026-06-15 00:02:56 +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,27 @@
|
||||
use serenity::model::prelude::*;
|
||||
use serenity::prelude::*;
|
||||
|
||||
use crate::commands::moderation_tools;
|
||||
|
||||
pub async fn handle_clear_messages(ctx: &Context, msg: &Message, args: &[&str]) {
|
||||
moderation_tools::handle_clear_messages(ctx, msg, args).await;
|
||||
}
|
||||
|
||||
pub struct ClearMessagesCommand;
|
||||
pub static COMMAND_DESCRIPTOR: ClearMessagesCommand = ClearMessagesCommand;
|
||||
|
||||
impl crate::commands::command_contract::CommandSpec for ClearMessagesCommand {
|
||||
fn metadata(&self) -> crate::commands::command_contract::CommandMetadata {
|
||||
crate::commands::command_contract::CommandMetadata {
|
||||
key: "clear_messages",
|
||||
command: "clear",
|
||||
category: "admin",
|
||||
params: "<nombre> [@membre/ID]",
|
||||
summary: "Supprime des messages dans le salon",
|
||||
description: "Supprime un nombre de messages, optionnellement filtres par membre.",
|
||||
examples: &["+clear 20", "+clear 20 @User"],
|
||||
alias_source_key: "clear_messages",
|
||||
default_aliases: &["purge"],
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user