From 46c792c78d3b5f4fdd600a7f2a4de93648862341 Mon Sep 17 00:00:00 2001 From: acdenisSK Date: Sat, 14 Jul 2018 11:30:20 +0200 Subject: [PATCH] Quickly rename to `no_dm_prefix` Minimize assumptions that `no_prefix` would work everywhere. --- src/framework/standard/command.rs | 2 +- src/framework/standard/configuration.rs | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/framework/standard/command.rs b/src/framework/standard/command.rs index f16414130ce..f4f455edda7 100644 --- a/src/framework/standard/command.rs +++ b/src/framework/standard/command.rs @@ -365,7 +365,7 @@ pub fn positions(ctx: &mut Context, msg: &Message, conf: &Configuration) -> Opti // If the above do not fill `positions`, then that means no kind of prefix was present. // Check if a no-prefix-execution is applicable. - if conf.no_prefix && private && positions.is_empty() { + if conf.no_dm_prefix && private && positions.is_empty() { positions.push(0); } } diff --git a/src/framework/standard/configuration.rs b/src/framework/standard/configuration.rs index 7b2caf5daaa..f3d66d64da6 100644 --- a/src/framework/standard/configuration.rs +++ b/src/framework/standard/configuration.rs @@ -53,7 +53,7 @@ pub struct Configuration { #[doc(hidden)] pub on_mention: Option>, #[doc(hidden)] pub owners: HashSet, #[doc(hidden)] pub prefixes: Vec, - #[doc(hidden)] pub no_prefix: bool, + #[doc(hidden)] pub no_dm_prefix: bool, #[doc(hidden)] pub delimiters: Vec, #[doc(hidden)] pub case_insensitive: bool, } @@ -403,8 +403,8 @@ impl Configuration { /// /// # Note /// Needs the `cache` feature to be enabled. Otherwise this does nothing. - pub fn no_prefix(mut self, b: bool) -> Self { - self.no_prefix = b; + pub fn no_dm_prefix(mut self, b: bool) -> Self { + self.no_dm_prefix = b; self } @@ -477,7 +477,7 @@ impl Default for Configuration { /// - **depth** to `5` /// - **on_mention** to `false` (basically) /// - **prefix** to `None` - /// - **no_prefix** to `false` + /// - **no_dm_prefix** to `false` /// - **delimiters** to vec![" "] /// - **case_insensitive** to `false` fn default() -> Configuration { @@ -487,7 +487,7 @@ impl Default for Configuration { dynamic_prefix: None, allow_whitespace: false, prefixes: vec![], - no_prefix: false, + no_dm_prefix: false, ignore_bots: true, owners: HashSet::default(), blocked_users: HashSet::default(),