aboutsummaryrefslogtreecommitdiff
path: root/src/framework/standard/command.rs
diff options
context:
space:
mode:
authoracdenisSK <[email protected]>2017-11-21 16:07:53 +0100
committeracdenisSK <[email protected]>2017-11-21 16:07:53 +0100
commitf61816ca141add5024e36e073764b7c824872ca4 (patch)
tree357317f5574698bb67c8a73f633443a50ed20d14 /src/framework/standard/command.rs
parentRemove client close handle (diff)
downloadserenity-f61816ca141add5024e36e073764b7c824872ca4.tar.xz
serenity-f61816ca141add5024e36e073764b7c824872ca4.zip
Add a way to execute code when a command is registered
Diffstat (limited to 'src/framework/standard/command.rs')
-rw-r--r--src/framework/standard/command.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/framework/standard/command.rs b/src/framework/standard/command.rs
index 5633fd6..4ace064 100644
--- a/src/framework/standard/command.rs
+++ b/src/framework/standard/command.rs
@@ -128,6 +128,9 @@ pub trait Command: Send + Sync + 'static {
fn options(&self) -> Arc<CommandOptions> {
Arc::clone(&DEFAULT_OPTIONS)
}
+
+ /// Called when the command gets registered.
+ fn init(&self) {}
}
impl Command for Arc<Command> {