diff --git a/src/framework/standard/mod.rs b/src/framework/standard/mod.rs index dec74bef328..2fed563ccf5 100644 --- a/src/framework/standard/mod.rs +++ b/src/framework/standard/mod.rs @@ -616,6 +616,14 @@ impl StandardFramework { impl Framework for StandardFramework { #[instrument(skip(self, ctx))] async fn dispatch(&self, mut ctx: Context, msg: Message) { + if let Some(error) = self.should_fail_common(&msg) { + if let Some(dispatch) = &self.dispatch { + dispatch(&mut ctx, &msg, error).await; + } + + return; + } + let mut stream = Stream::new(&msg.content); stream.take_while_char(|c| c.is_whitespace()); @@ -638,14 +646,6 @@ impl Framework for StandardFramework { return; } - if let Some(error) = self.should_fail_common(&msg) { - if let Some(dispatch) = &self.dispatch { - dispatch(&mut ctx, &msg, error).await; - } - - return; - } - let invocation = parse::command( &ctx, &msg,