Skip to content

Commit

Permalink
feat: command descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
oSumAtrIX committed Aug 21, 2022
1 parent 3f1d6af commit 8045e18
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/commands/configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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);
Expand All @@ -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?;
Expand Down
4 changes: 4 additions & 0 deletions src/commands/moderation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<'_>,
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -285,3 +287,5 @@ pub async fn purge(
.await?;
Ok(())
}


0 comments on commit 8045e18

Please sign in to comment.