diff options
| author | Maiddog <[email protected]> | 2017-08-26 17:55:43 -0500 |
|---|---|---|
| committer | alex <[email protected]> | 2017-08-27 00:55:43 +0200 |
| commit | 3e0b1032d80a1847558a752e8316d97f9ae58f04 (patch) | |
| tree | ca65390091cb3c0ab98b6497a1447ba69df3d20d /src/framework/standard/create_command.rs | |
| parent | Use `$crate` for `Args` (diff) | |
| download | serenity-3e0b1032d80a1847558a752e8316d97f9ae58f04.tar.xz serenity-3e0b1032d80a1847558a752e8316d97f9ae58f04.zip | |
Add ability to play DCA and Opus files. (#148)
Diffstat (limited to 'src/framework/standard/create_command.rs')
| -rw-r--r-- | src/framework/standard/create_command.rs | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/framework/standard/create_command.rs b/src/framework/standard/create_command.rs index 97bf092..0a467e1 100644 --- a/src/framework/standard/create_command.rs +++ b/src/framework/standard/create_command.rs @@ -11,9 +11,9 @@ pub struct CreateCommand(pub Command); impl CreateCommand { /// Adds multiple aliases. pub fn batch_known_as(mut self, names: Vec<&str>) -> Self { - self.0 - .aliases - .extend(names.into_iter().map(|n| n.to_owned())); + self.0.aliases.extend( + names.into_iter().map(|n| n.to_owned()), + ); self } @@ -115,7 +115,10 @@ impl CreateCommand { /// /// You can return `Err(string)` if there's an error. pub fn exec_help<F>(mut self, f: F) -> Self - where F: Fn(&mut Context, &Message, HashMap<String, Arc<CommandGroup>>, Args) + where F: Fn(&mut Context, + &Message, + HashMap<String, Arc<CommandGroup>>, + Args) -> Result<(), String> + 'static { self.0.exec = CommandType::WithCommands(Box::new(f)); |