diff options
Diffstat (limited to 'src/framework')
| -rw-r--r-- | src/framework/mod.rs | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/framework/mod.rs b/src/framework/mod.rs index d55c26d..ba80e60 100644 --- a/src/framework/mod.rs +++ b/src/framework/mod.rs @@ -931,17 +931,19 @@ impl ::Framework for BuiltinFramework { let groups = self.groups.clone(); let args = { - let content = message.content[position..].trim(); + let mut content = message.content[position..].trim(); + content = content[command_length..].trim(); if command.use_quotes { utils::parse_quotes(&content[command_length..]) } else { - let delimeter = { - let delimeter = self.configuration.delimeters.iter().find(|d| content[command_length..].contains(d.as_str())); - delimeter.map(|s| s.as_str()).unwrap_or(" ") - }; + let delimeter = self.configuration.delimeters + .iter() + .find(|d| content.contains(d.as_str())) + .map(|s| s.as_str()) + .unwrap_or(" "); - content[command_length..] + content .split(delimeter) .map(|arg| arg.to_owned()) .collect::<Vec<String>>() |