diff options
| author | Lakelezz <[email protected]> | 2018-01-31 18:01:30 +0100 |
|---|---|---|
| committer | Zeyla Hellyer <[email protected]> | 2018-02-04 07:54:31 -0800 |
| commit | b41af391f09ac071e368f8536391da22f426dc07 (patch) | |
| tree | ee1e5690e2fea37c4279a8d48c1e428bcb8dc9e6 /src/framework | |
| parent | Remove byteorder dep in example 10 (diff) | |
| download | serenity-b41af391f09ac071e368f8536391da22f426dc07.tar.xz serenity-b41af391f09ac071e368f8536391da22f426dc07.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, |