aboutsummaryrefslogtreecommitdiff
path: root/src/framework
diff options
context:
space:
mode:
Diffstat (limited to 'src/framework')
-rw-r--r--src/framework/command.rs2
-rw-r--r--src/framework/create_command.rs2
-rw-r--r--src/framework/mod.rs2
3 files changed, 3 insertions, 3 deletions
diff --git a/src/framework/command.rs b/src/framework/command.rs
index 2aa6bbe..a1c25de 100644
--- a/src/framework/command.rs
+++ b/src/framework/command.rs
@@ -4,7 +4,7 @@ use ::client::Context;
use ::model::{Message, Permissions};
use std::collections::HashMap;
-pub type Check = Fn(&mut Context, &Message) -> bool + Send + Sync + 'static;
+pub type Check = Fn(&mut Context, &Message, &Arc<Command>) -> bool + Send + Sync + 'static;
pub type Exec = Fn(&mut Context, &Message, Vec<String>) -> Result<(), String> + Send + Sync + 'static;
pub type Help = Fn(&mut Context, &Message, HashMap<String, Arc<CommandGroup>>, &[String]) -> Result<(), String> + Send + Sync + 'static;
pub type BeforeHook = Fn(&mut Context, &Message, &String) -> bool + Send + Sync + 'static;
diff --git a/src/framework/create_command.rs b/src/framework/create_command.rs
index abed3ea..804b7c3 100644
--- a/src/framework/create_command.rs
+++ b/src/framework/create_command.rs
@@ -62,7 +62,7 @@ impl CreateCommand {
/// }
/// ```
pub fn check<F>(mut self, check: F) -> Self
- where F: Fn(&mut Context, &Message) -> bool + Send + Sync + 'static {
+ where F: Fn(&mut Context, &Message, &Arc<Command>) -> bool + Send + Sync + 'static {
self.0.checks.push(Box::new(check));
self
diff --git a/src/framework/mod.rs b/src/framework/mod.rs
index c3b683e..cb65682 100644
--- a/src/framework/mod.rs
+++ b/src/framework/mod.rs
@@ -498,7 +498,7 @@ impl Framework {
if command.owners_only {
Some(DispatchError::OnlyForOwners)
- } else if !command.checks.iter().all(|check| (check)(&mut context, message)) {
+ } else if !command.checks.iter().all(|check| (check)(&mut context, message, command)) {
Some(DispatchError::CheckFailed)
} else if self.configuration.blocked_users.contains(&message.author.id) {
Some(DispatchError::BlockedUser)