mirror of
https://github.com/arthur-pbty/shadowbot.git
synced 2026-06-05 08:11:44 +02:00
3e69185296
- 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`.
28 lines
1.0 KiB
Rust
28 lines
1.0 KiB
Rust
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"],
|
|
}
|
|
}
|
|
}
|