diff options
Diffstat (limited to 'src/ext/framework')
| -rw-r--r-- | src/ext/framework/mod.rs | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/ext/framework/mod.rs b/src/ext/framework/mod.rs index e4c57f3..4dd394e 100644 --- a/src/ext/framework/mod.rs +++ b/src/ext/framework/mod.rs @@ -477,13 +477,17 @@ impl Framework { let after = self.after.clone(); let groups = self.groups.clone(); - let args = if command.use_quotes { - utils::parse_quotes(&message.content[position + command_length..]) - } else { - message.content[position + command_length..] - .split_whitespace() - .map(|arg| arg.to_owned()) - .collect::<Vec<String>>() + let args = { + let content = message.content[position..].trim(); + + if command.use_quotes { + utils::parse_quotes(&content[command_length..]) + } else { + content[command_length..] + .split_whitespace() + .map(|arg| arg.to_owned()) + .collect::<Vec<String>>() + } }; if let Some(error) = self.should_fail(&mut context, &message, &command, args.len(), &to_check, &built) { |