From c6a5fe4ef9dc07b9b14f742440a35ba6ea02058b Mon Sep 17 00:00:00 2001 From: acdenisSK Date: Sun, 25 Mar 2018 19:25:01 +0200 Subject: Fix help precendence --- src/framework/standard/mod.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/framework') diff --git a/src/framework/standard/mod.rs b/src/framework/standard/mod.rs index 1eb1ad2..8db7a7d 100644 --- a/src/framework/standard/mod.rs +++ b/src/framework/standard/mod.rs @@ -910,6 +910,10 @@ impl StandardFramework { } /// Sets what code should be executed when a user sends `(prefix)help`. + /// + /// If a command named `help` was set with [`command`], then this takes precendence first. + /// + /// [`command`]: #method.command pub fn help(mut self, f: HelpFunction) -> Self { let a = CreateHelpCommand(HelpOptions::default(), f).finish(); @@ -1011,7 +1015,6 @@ impl Framework for StandardFramework { let before = self.before.clone(); let after = self.after.clone(); - // This is a special case. if to_check == "help" { let help = self.help.clone(); @@ -1034,8 +1037,6 @@ impl Framework for StandardFramework { }); return; } - - return; } if let Some(&CommandOrAlias::Command(ref command)) = -- cgit v1.2.3