aboutsummaryrefslogtreecommitdiff
path: root/src/ext/framework/create_command.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/ext/framework/create_command.rs')
-rw-r--r--src/ext/framework/create_command.rs17
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
}
}
}