diff options
| author | Mishio595 <[email protected]> | 2018-07-12 11:35:39 -0600 |
|---|---|---|
| committer | Mishio595 <[email protected]> | 2018-07-12 11:35:39 -0600 |
| commit | 026a37ffe12096a1da263b028df48a8d2909baa3 (patch) | |
| tree | 1d1bf8f9c505408f13b7fd6f877bcf3fd15fa43c /src/framework/standard/mod.rs | |
| parent | Add 3rd param to MessageUpdateEvent Option that contains the old message if f... (diff) | |
| download | serenity-026a37ffe12096a1da263b028df48a8d2909baa3.tar.xz serenity-026a37ffe12096a1da263b028df48a8d2909baa3.zip | |
Add checks for groups
Diffstat (limited to 'src/framework/standard/mod.rs')
| -rw-r--r-- | src/framework/standard/mod.rs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/framework/standard/mod.rs b/src/framework/standard/mod.rs index 435069e..db31e0d 100644 --- a/src/framework/standard/mod.rs +++ b/src/framework/standard/mod.rs @@ -488,6 +488,7 @@ impl StandardFramework { mut context: &mut Context, message: &Message, command: &Arc<CommandOptions>, + group: &Arc<CommandGroup>, args: &mut Args, to_check: &str, built: &str) @@ -600,12 +601,17 @@ impl StandardFramework { } } - let all_passed = command + let all_group_checks_passed = group .checks .iter() .all(|check| (check.0)(&mut context, message, args, command)); - if all_passed { + let all_command_checks_passed = command + .checks + .iter() + .all(|check| (check.0)(&mut context, message, args, command)); + + if all_group_checks_passed && all_command_checks_passed { None } else { Some(DispatchError::CheckFailed) |