diff options
| author | acdenisSK <[email protected]> | 2017-08-12 19:30:35 +0200 |
|---|---|---|
| committer | acdenisSK <[email protected]> | 2017-08-12 19:30:35 +0200 |
| commit | fdfb1846083165629feca81b5169ceaf331289c5 (patch) | |
| tree | 7dcdabb33703006edb00e326c968fb44a7a888b6 /src/framework/mod.rs | |
| parent | Add support for custom delimeters (diff) | |
| download | serenity-fdfb1846083165629feca81b5169ceaf331289c5.tar.xz serenity-fdfb1846083165629feca81b5169ceaf331289c5.zip | |
Rewamp the custom delimeter functionality to support more
Diffstat (limited to 'src/framework/mod.rs')
| -rw-r--r-- | src/framework/mod.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/framework/mod.rs b/src/framework/mod.rs index ce484e4..d55c26d 100644 --- a/src/framework/mod.rs +++ b/src/framework/mod.rs @@ -936,8 +936,13 @@ impl ::Framework for BuiltinFramework { 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(" ") + }; + content[command_length..] - .split(&self.configuration.delimeter) + .split(delimeter) .map(|arg| arg.to_owned()) .collect::<Vec<String>>() } |