Skip to content

Commit

Permalink
Quickly rename to no_dm_prefix
Browse files Browse the repository at this point in the history
Minimize assumptions that `no_prefix` would work everywhere.
  • Loading branch information
arqunis committed Jul 14, 2018
1 parent 10bbffe commit 46c792c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/framework/standard/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down
10 changes: 5 additions & 5 deletions src/framework/standard/configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ pub struct Configuration {
#[doc(hidden)] pub on_mention: Option<Vec<String>>,
#[doc(hidden)] pub owners: HashSet<UserId>,
#[doc(hidden)] pub prefixes: Vec<String>,
#[doc(hidden)] pub no_prefix: bool,
#[doc(hidden)] pub no_dm_prefix: bool,
#[doc(hidden)] pub delimiters: Vec<String>,
#[doc(hidden)] pub case_insensitive: bool,
}
Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -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 {
Expand All @@ -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(),
Expand Down

0 comments on commit 46c792c

Please sign in to comment.