Skip to content

Commit

Permalink
chore(commands): rearrange the command source code.
Browse files Browse the repository at this point in the history
  • Loading branch information
evieluvsrainbows committed Jul 19, 2024
1 parent 71574ba commit 7ac042b
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/commands/utilities/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@ use poise::command;

use crate::{Context, Error};

/// Shows the help menu.
#[command(slash_command, track_edits)]
pub async fn help(ctx: Context<'_>, #[description = "Specific command to show help about"] command: Option<String>) -> Result<(), Error> {
let config = poise::builtins::HelpConfiguration { ..Default::default() };
poise::builtins::help(ctx, command.as_deref(), config).await?;
Ok(())
}

/// Says hello to the user who initializes the command.
#[command(slash_command)]
pub async fn hello(ctx: Context<'_>) -> Result<(), Error> {
Expand All @@ -15,11 +23,3 @@ pub async fn source(ctx: Context<'_>) -> Result<(), Error> {
ctx.reply("GitHub repository: <https://github.com/evelynharthbrooke/Taliyah>").await?;
Ok(())
}

/// Shows the help menu.
#[command(slash_command, track_edits)]
pub async fn help(ctx: Context<'_>, #[description = "Specific command to show help about"] command: Option<String>) -> Result<(), Error> {
let config = poise::builtins::HelpConfiguration { ..Default::default() };
poise::builtins::help(ctx, command.as_deref(), config).await?;
Ok(())
}

0 comments on commit 7ac042b

Please sign in to comment.