diff options
| author | acdenisSK <[email protected]> | 2017-09-29 16:13:01 +0200 |
|---|---|---|
| committer | acdenisSK <[email protected]> | 2017-09-29 16:13:01 +0200 |
| commit | d90b90c7f3d8a368acbab46150f199866562229a (patch) | |
| tree | 42b9a5c2a061ba662fef19277d2711c60b8c6570 /src/framework/standard/create_group.rs | |
| parent | Fix User::tag and CurrentUser::tag discrim output (diff) | |
| download | serenity-d90b90c7f3d8a368acbab46150f199866562229a.tar.xz serenity-d90b90c7f3d8a368acbab46150f199866562229a.zip | |
Change the way users' command handlers are stored as
Diffstat (limited to 'src/framework/standard/create_group.rs')
| -rw-r--r-- | src/framework/standard/create_group.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/framework/standard/create_group.rs b/src/framework/standard/create_group.rs index 699e56f..15db5a4 100644 --- a/src/framework/standard/create_group.rs +++ b/src/framework/standard/create_group.rs @@ -70,14 +70,14 @@ impl CreateGroup { } /// Adds a command to group with simplified API. - /// You can return Err(string) if there's an error. - pub fn on<F>(mut self, command_name: &str, f: F) -> Self - where F: Fn(&mut Context, &Message, Args) -> Result<(), CommandError> + Send + Sync + 'static { + /// You can return Err(From::from(string)) if there's an error. + pub fn on(mut self, name: &str, + f: fn(&mut Context, &Message, Args) -> Result<(), CommandError>) -> Self { let cmd = Arc::new(Command::new(f)); self.0 .commands - .insert(command_name.to_owned(), CommandOrAlias::Command(cmd)); + .insert(name.to_string(), CommandOrAlias::Command(cmd)); self } |