Skip to content

Commit

Permalink
Fix framework owners_only check
Browse files Browse the repository at this point in the history
  • Loading branch information
fwrs authored and zeyla committed Dec 16, 2016
1 parent 00fb61b commit 6355288
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/ext/framework/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,14 @@ impl Framework {
let is_owner = self.configuration.owners.contains(&message.author.id);
// Most of the checks don't apply to owners.
if !is_owner {
if command.owners_only {
if let Some(ref message) = self.configuration.invalid_permission_message {
let _ = context.say(message);
}

return;
}

if !self.configuration.allow_dm {
if let Some(ref message) = self.configuration.no_dm_message {
let _ = context.say(message);
Expand Down Expand Up @@ -415,12 +423,6 @@ impl Framework {
continue 'outer;
}
}
} else if command.owners_only {
if let Some(ref message) = self.configuration.invalid_permission_message {
let _ = context.say(message);
}

return;
}

let before = self.before.clone();
Expand Down

0 comments on commit 6355288

Please sign in to comment.