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/create_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/create_command.rs')
| -rw-r--r-- | src/ext/framework/create_command.rs | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/ext/framework/create_command.rs b/src/ext/framework/create_command.rs index 7a1d744..99505e5 100644 --- a/src/ext/framework/create_command.rs +++ b/src/ext/framework/create_command.rs @@ -140,9 +140,17 @@ impl CreateCommand { self } - /// Maximum amount of arguments that can be passed. - pub fn required_permissions(mut self, required_permissions: Permissions) -> Self { - self.0.required_permissions = required_permissions; + /// Whether command can be used only privately or not. + pub fn owners_only(mut self, owners_only: bool) -> Self { + self.0.owners_only = owners_only; + + self + } + + /// The permissions that a user must have in the contextual channel in order + /// for the command to be processed. + pub fn required_permissions(mut self, permissions: Permissions) -> Self { + self.0.required_permissions = permissions; self } @@ -186,7 +194,8 @@ impl Default for Command { required_permissions: Permissions::empty(), dm_only: false, guild_only: false, - help_available: true + help_available: true, + owners_only: false } } } |