aboutsummaryrefslogtreecommitdiff
path: root/src/framework/create_command.rs
diff options
context:
space:
mode:
authorZeyla Hellyer <[email protected]>2017-05-24 07:44:46 -0700
committerZeyla Hellyer <[email protected]>2017-05-24 17:31:48 -0700
commit75749ac3f894a2a41b54287a7e7c9114152c99e4 (patch)
tree7a2e6aa27ce8e37a6a80c95fddf7d14adea1a333 /src/framework/create_command.rs
parentMove Reaction struct into its proper place (diff)
downloadserenity-75749ac3f894a2a41b54287a7e7c9114152c99e4.tar.xz
serenity-75749ac3f894a2a41b54287a7e7c9114152c99e4.zip
Re-order methods/fields in the framework
This will help with readability in the generated documentation.
Diffstat (limited to 'src/framework/create_command.rs')
-rw-r--r--src/framework/create_command.rs28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/framework/create_command.rs b/src/framework/create_command.rs
index 512e82c..a31c91a 100644
--- a/src/framework/create_command.rs
+++ b/src/framework/create_command.rs
@@ -9,20 +9,6 @@ use ::model::{Message, Permissions};
pub struct CreateCommand(pub Command);
impl CreateCommand {
- /// Adds a ratelimit bucket.
- pub fn bucket(mut self, bucket: &str) -> Self {
- self.0.bucket = Some(bucket.to_owned());
-
- self
- }
-
- /// Adds an alias, allowing users to use the command under a different name.
- pub fn known_as(mut self, name: &str) -> Self {
- self.0.aliases.push(name.to_owned());
-
- self
- }
-
/// Adds multiple aliases.
pub fn batch_known_as(mut self, names: Vec<&str>) -> Self {
for n in names {
@@ -32,6 +18,13 @@ impl CreateCommand {
self
}
+ /// Adds a ratelimit bucket.
+ pub fn bucket(mut self, bucket: &str) -> Self {
+ self.0.bucket = Some(bucket.to_owned());
+
+ self
+ }
+
/// Adds a "check" to a command, which checks whether or not the command's
/// function should be called.
///
@@ -149,6 +142,13 @@ impl CreateCommand {
self
}
+ /// Adds an alias, allowing users to use the command under a different name.
+ pub fn known_as(mut self, name: &str) -> Self {
+ self.0.aliases.push(name.to_owned());
+
+ self
+ }
+
/// Maximum amount of arguments that can be passed.
pub fn max_args(mut self, max_args: i32) -> Self {
self.0.max_args = Some(max_args);