diff options
| author | Maiddog <[email protected]> | 2017-05-08 22:55:49 -0500 |
|---|---|---|
| committer | zeyla <[email protected]> | 2017-05-08 20:55:49 -0700 |
| commit | 9ec05e701bdbadad39847f0dcc18d5156ecdde02 (patch) | |
| tree | de150132a2ea7939e56e30554658631f16244993 /src/ext/framework/command.rs | |
| parent | Fix permissions when sending to DMs or groups (diff) | |
| download | serenity-9ec05e701bdbadad39847f0dcc18d5156ecdde02.tar.xz serenity-9ec05e701bdbadad39847f0dcc18d5156ecdde02.zip | |
Check if message starts with dynamic_prefix result
Diffstat (limited to 'src/ext/framework/command.rs')
| -rw-r--r-- | src/ext/framework/command.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/ext/framework/command.rs b/src/ext/framework/command.rs index 76ca416..5f43284 100644 --- a/src/ext/framework/command.rs +++ b/src/ext/framework/command.rs @@ -102,7 +102,9 @@ pub fn positions(ctx: &mut Context, content: &str, conf: &Configuration) -> Opti positions.push(mention_end); } else if let Some(ref func) = conf.dynamic_prefix { if let Some(x) = func(ctx) { - positions.push(x.len()); + if content.starts_with(&x) { + positions.push(x.len()); + } } else { for n in conf.prefixes.clone() { if content.starts_with(&n) { |