diff options
| author | Lakelezz <[email protected]> | 2018-07-15 16:48:06 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2018-07-15 16:48:06 +0200 |
| commit | 29480e5eeccc12afc0e9020373647786736aabc7 (patch) | |
| tree | 347ade11861894d95de87274e5c534d6795b282b /src/framework/standard/command.rs | |
| parent | typos (diff) | |
| download | serenity-29480e5eeccc12afc0e9020373647786736aabc7.tar.xz serenity-29480e5eeccc12afc0e9020373647786736aabc7.zip | |
Add checks for groups (#349)
Diffstat (limited to 'src/framework/standard/command.rs')
| -rw-r--r-- | src/framework/standard/command.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/framework/standard/command.rs b/src/framework/standard/command.rs index f4f455e..23f2f0c 100644 --- a/src/framework/standard/command.rs +++ b/src/framework/standard/command.rs @@ -101,6 +101,9 @@ pub struct CommandGroup { pub guild_only: bool, pub owners_only: bool, pub help: Option<Arc<Help>>, + /// A set of checks to be called prior to executing the command-group. The checks + /// will short-circuit on the first check that returns `false`. + pub checks: Vec<Check>, } impl Default for CommandGroup { @@ -116,6 +119,7 @@ impl Default for CommandGroup { owners_only: false, allowed_roles: Vec::new(), help: None, + checks: Vec::new(), } } } @@ -256,7 +260,6 @@ impl Default for HelpOptions { } } - lazy_static! { static ref DEFAULT_OPTIONS: Arc<CommandOptions> = Arc::new(CommandOptions::default()); } |