From 9ec05e701bdbadad39847f0dcc18d5156ecdde02 Mon Sep 17 00:00:00 2001 From: Maiddog Date: Mon, 8 May 2017 22:55:49 -0500 Subject: Check if message starts with dynamic_prefix result --- src/ext/framework/command.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/ext/framework/command.rs') 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) { -- cgit v1.2.3