From 966cb3e00a7c8a803a299db8f792d42542d5896a Mon Sep 17 00:00:00 2001 From: Lakelezz <12222135+Lakelezz@users.noreply.github.com> Date: Sun, 9 Sep 2018 13:14:50 +0200 Subject: Check if bots are ignored before dispatching `unrecognised_command` (#381) --- src/framework/standard/mod.rs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/framework/standard/mod.rs b/src/framework/standard/mod.rs index e1a1fb1..aa32d11 100644 --- a/src/framework/standard/mod.rs +++ b/src/framework/standard/mod.rs @@ -1187,11 +1187,14 @@ impl Framework for StandardFramework { } } - if let &Some(ref unrecognised_command) = &self.unrecognised_command { - let unrecognised_command = unrecognised_command.clone(); - threadpool.execute(move || { - (unrecognised_command)(&mut context, &message, &unrecognised_command_name); - }); + if !(self.configuration.ignore_bots && message.author.bot) { + + if let &Some(ref unrecognised_command) = &self.unrecognised_command { + let unrecognised_command = unrecognised_command.clone(); + threadpool.execute(move || { + (unrecognised_command)(&mut context, &message, &unrecognised_command_name); + }); + } } } -- cgit v1.2.3