diff options
| author | acdenisSK <[email protected]> | 2017-09-01 19:21:38 +0200 |
|---|---|---|
| committer | acdenisSK <[email protected]> | 2017-09-01 19:21:38 +0200 |
| commit | deee38d87d71a918b6d8270dbfaffeb0a7234508 (patch) | |
| tree | c1d5e3c92fc43ba50e3245192d1531b1945d50d4 /src/framework/standard/mod.rs | |
| parent | Add num_args (#156) (diff) | |
| download | serenity-deee38d87d71a918b6d8270dbfaffeb0a7234508.tar.xz serenity-deee38d87d71a918b6d8270dbfaffeb0a7234508.zip | |
Add case insensitivity
Diffstat (limited to 'src/framework/standard/mod.rs')
| -rw-r--r-- | src/framework/standard/mod.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/framework/standard/mod.rs b/src/framework/standard/mod.rs index 04ebc5f..a8570e6 100644 --- a/src/framework/standard/mod.rs +++ b/src/framework/standard/mod.rs @@ -861,7 +861,7 @@ impl Framework for StandardFramework { built = points_to.to_owned(); } - let to_check = if let Some(ref prefix) = group.prefix { + let mut to_check = if let Some(ref prefix) = group.prefix { if built.starts_with(prefix) && command_length > prefix.len() + 1 { built[(prefix.len() + 1)..].to_owned() } else { @@ -871,6 +871,12 @@ impl Framework for StandardFramework { built.clone() }; + to_check = if self.configuration.case_insensitive { + to_check.to_lowercase() + } else { + to_check + }; + if let Some(&CommandOrAlias::Command(ref command)) = group.commands.get(&to_check) { let before = self.before.clone(); |