diff options
| author | acdenisSK <[email protected]> | 2017-11-21 16:07:53 +0100 |
|---|---|---|
| committer | acdenisSK <[email protected]> | 2017-11-21 16:07:53 +0100 |
| commit | f61816ca141add5024e36e073764b7c824872ca4 (patch) | |
| tree | 357317f5574698bb67c8a73f633443a50ed20d14 /src/framework/standard/create_command.rs | |
| parent | Remove client close handle (diff) | |
| download | serenity-f61816ca141add5024e36e073764b7c824872ca4.tar.xz serenity-f61816ca141add5024e36e073764b7c824872ca4.zip | |
Add a way to execute code when a command is registered
Diffstat (limited to 'src/framework/standard/create_command.rs')
| -rw-r--r-- | src/framework/standard/create_command.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/framework/standard/create_command.rs b/src/framework/standard/create_command.rs index 4137b91..3a6601f 100644 --- a/src/framework/standard/create_command.rs +++ b/src/framework/standard/create_command.rs @@ -212,7 +212,11 @@ impl CreateCommand { Arc::new(A(Arc::new(options), func)) }, - FnOrCommand::Command(cmd) => cmd, + FnOrCommand::Command(cmd) => { + cmd.init(); + + cmd + }, } } } |