diff options
| author | Maiddog <[email protected]> | 2017-08-31 12:03:11 -0500 |
|---|---|---|
| committer | alex <[email protected]> | 2017-08-31 19:03:11 +0200 |
| commit | aace5fdb7f6eb71c143414c491005e378e299221 (patch) | |
| tree | 433a1e4a94863e4dc113d5e55629d4d96b2d7b9d /src/framework | |
| parent | Make role references attainable via name (diff) | |
| download | serenity-aace5fdb7f6eb71c143414c491005e378e299221.tar.xz serenity-aace5fdb7f6eb71c143414c491005e378e299221.zip | |
Add num_args (#156)
Diffstat (limited to 'src/framework')
| -rw-r--r-- | src/framework/standard/create_command.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/framework/standard/create_command.rs b/src/framework/standard/create_command.rs index 0a467e1..4fe11f2 100644 --- a/src/framework/standard/create_command.rs +++ b/src/framework/standard/create_command.rs @@ -178,6 +178,14 @@ impl CreateCommand { self } + /// Exact number of arguments that should be passed. + pub fn num_args(mut self, num_args: i32) -> Self { + self.0.min_args = Some(num_args); + self.0.max_args = Some(num_args); + + self + } + /// 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; |