From 8045e180e91f1123c1a4c92c1e7d697be61e4bf4 Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Sun, 21 Aug 2022 22:15:00 +0200 Subject: [PATCH] feat: command descriptions --- src/commands/configuration.rs | 3 +++ src/commands/moderation.rs | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/src/commands/configuration.rs b/src/commands/configuration.rs index e308138..6d69a28 100644 --- a/src/commands/configuration.rs +++ b/src/commands/configuration.rs @@ -3,6 +3,7 @@ use tracing::debug; use crate::utils::bot::load_configuration; use crate::{Context, Error}; +/// Reload the Discord bot. #[poise::command(slash_command)] pub async fn reload(ctx: Context<'_>) -> Result<(), Error> { // Update the configuration @@ -25,6 +26,7 @@ pub async fn reload(ctx: Context<'_>) -> Result<(), Error> { Ok(()) } +/// Stop the Discord bot. #[poise::command(slash_command)] pub async fn stop(ctx: Context<'_>) -> Result<(), Error> { debug!("{} stopped the bot.", ctx.author().name); @@ -46,6 +48,7 @@ pub async fn stop(ctx: Context<'_>) -> Result<(), Error> { Ok(()) } +/// Register slash commands. #[poise::command(prefix_command, slash_command, ephemeral = true)] pub async fn register(ctx: Context<'_>) -> Result<(), Error> { poise::builtins::register_application_commands_buttons(ctx).await?; diff --git a/src/commands/moderation.rs b/src/commands/moderation.rs index 8b45c35..468347e 100644 --- a/src/commands/moderation.rs +++ b/src/commands/moderation.rs @@ -8,6 +8,7 @@ use crate::db::model::Muted; use crate::utils::moderation::{queue_unmute_member, respond_mute_command, ModerationKind}; use crate::{Context, Error}; +/// Unmute a member. #[poise::command(slash_command)] pub async fn unmute( ctx: Context<'_>, @@ -42,6 +43,7 @@ pub async fn unmute( .await } +/// Mute a member. #[allow(clippy::too_many_arguments)] #[poise::command(slash_command)] pub async fn mute( @@ -285,3 +287,5 @@ pub async fn purge( .await?; Ok(()) } + +