From 7ac042b7c580f4b0fab60a7cc5f72dfdaae7e6f6 Mon Sep 17 00:00:00 2001 From: Evelyn Harthbrooke Date: Fri, 19 Jul 2024 04:58:50 -0600 Subject: [PATCH] chore(commands): rearrange the command source code. --- src/commands/utilities/mod.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/commands/utilities/mod.rs b/src/commands/utilities/mod.rs index 28b409c..fe15e50 100644 --- a/src/commands/utilities/mod.rs +++ b/src/commands/utilities/mod.rs @@ -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) -> 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> { @@ -15,11 +23,3 @@ pub async fn source(ctx: Context<'_>) -> Result<(), Error> { ctx.reply("GitHub repository: ").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) -> Result<(), Error> { - let config = poise::builtins::HelpConfiguration { ..Default::default() }; - poise::builtins::help(ctx, command.as_deref(), config).await?; - Ok(()) -}