aboutsummaryrefslogtreecommitdiff
path: root/src/ext/framework/command.rs
diff options
context:
space:
mode:
authorMaiddog <[email protected]>2017-05-08 22:55:49 -0500
committerzeyla <[email protected]>2017-05-08 20:55:49 -0700
commit9ec05e701bdbadad39847f0dcc18d5156ecdde02 (patch)
treede150132a2ea7939e56e30554658631f16244993 /src/ext/framework/command.rs
parentFix permissions when sending to DMs or groups (diff)
downloadserenity-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.rs4
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) {