diff options
| author | Lakelezz <[email protected]> | 2018-01-31 18:01:30 +0100 |
|---|---|---|
| committer | alex <[email protected]> | 2018-01-31 18:01:30 +0100 |
| commit | d2400742f657d9f8c432a440810d49e63339f5aa (patch) | |
| tree | 23294ec5c1bd2b4eb832846b5085b6beea6dc76b /src/framework | |
| parent | Remove byteorder dep in example 10 (diff) | |
| download | serenity-d2400742f657d9f8c432a440810d49e63339f5aa.tar.xz serenity-d2400742f657d9f8c432a440810d49e63339f5aa.zip | |
Fix case insensitivity for aliases (#262)
Diffstat (limited to 'src/framework')
| -rw-r--r-- | src/framework/standard/mod.rs | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/framework/standard/mod.rs b/src/framework/standard/mod.rs index f9b20e8..16e7757 100644 --- a/src/framework/standard/mod.rs +++ b/src/framework/standard/mod.rs @@ -947,6 +947,12 @@ impl Framework for StandardFramework { for group in groups.values() { let command_length = built.len(); + built = if self.configuration.case_insensitive { + built.to_lowercase() + } else { + built + }; + let cmd = group.commands.get(&built); if let Some(&CommandOrAlias::Alias(ref points_to)) = cmd { @@ -963,12 +969,6 @@ impl Framework for StandardFramework { built.clone() }; - to_check = if self.configuration.case_insensitive { - to_check.to_lowercase() - } else { - to_check - }; - let mut args = { let content = message.content.chars().skip(position).skip_while(|x| x.is_whitespace()) .skip(command_length).collect::<String>(); @@ -1009,6 +1009,7 @@ impl Framework for StandardFramework { if let Some(&CommandOrAlias::Command(ref command)) = group.commands.get(&to_check) { let command = Arc::clone(command); + if let Some(error) = self.should_fail( &mut context, &message, |