diff options
| author | Illia <[email protected]> | 2016-12-14 17:19:16 +0300 |
|---|---|---|
| committer | Austin Hellyer <[email protected]> | 2016-12-14 11:35:28 -0800 |
| commit | a39647d3ba1650a4dd4c92bd40001959828000c7 (patch) | |
| tree | 3065d93509b494622dac457aa8540982454b01c2 /src/ext/framework/command.rs | |
| parent | Release v0.1.2 (diff) | |
| download | serenity-a39647d3ba1650a4dd4c92bd40001959828000c7.tar.xz serenity-a39647d3ba1650a4dd4c92bd40001959828000c7.zip | |
Framework blocks, disabled commands, improvements
Diffstat (limited to 'src/ext/framework/command.rs')
| -rw-r--r-- | src/ext/framework/command.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/ext/framework/command.rs b/src/ext/framework/command.rs index c1e9197..acddca9 100644 --- a/src/ext/framework/command.rs +++ b/src/ext/framework/command.rs @@ -8,7 +8,7 @@ use std::collections::HashMap; pub type Check = Fn(&Context, &Message) -> bool + Send + Sync + 'static; pub type Exec = Fn(&Context, &Message, Vec<String>) -> Result<(), String> + Send + Sync + 'static; pub type Help = Fn(&Context, &Message, HashMap<String, Arc<CommandGroup>>, Vec<String>) -> Result<(), String> + Send + Sync + 'static; -pub type Hook = Fn(&Context, &Message, &String) + Send + Sync + 'static; +pub type BeforeHook = Fn(&Context, &Message, &String) -> bool + Send + Sync + 'static; pub type AfterHook = Fn(&Context, &Message, &String, Result<(), String>) + Send + Sync + 'static; #[doc(hidden)] pub type InternalCommand = Arc<Command>; @@ -55,6 +55,8 @@ pub struct Command { pub dm_only: bool, /// Whether command can be used only in guilds or not. pub guild_only: bool, + /// Whether command can only be used by owners or not. + pub owners_only: bool, } impl Command { @@ -73,6 +75,7 @@ impl Command { min_args: None, max_args: None, required_permissions: Permissions::empty(), + owners_only: false, } } } |