diff options
| author | Lakelezz <[email protected]> | 2018-09-09 13:14:50 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2018-09-09 13:14:50 +0200 |
| commit | 966cb3e00a7c8a803a299db8f792d42542d5896a (patch) | |
| tree | cf8326607fec0a1a5cfdd10b3768dff43fb7b251 /src | |
| parent | Suggest similar commands when using help (#377) (diff) | |
| download | serenity-966cb3e00a7c8a803a299db8f792d42542d5896a.tar.xz serenity-966cb3e00a7c8a803a299db8f792d42542d5896a.zip | |
Check if bots are ignored before dispatching `unrecognised_command` (#381)
Diffstat (limited to 'src')
| -rw-r--r-- | src/framework/standard/mod.rs | 13 |
1 files changed, 8 insertions, 5 deletions
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); + }); + } } } |