aboutsummaryrefslogtreecommitdiff
path: root/examples/06_command_framework/src
diff options
context:
space:
mode:
authorTaavi <[email protected]>2017-01-02 03:38:36 +0300
committerzeyla <[email protected]>2017-01-01 16:38:36 -0800
commit18cc152769a35cd1705f045b9815cc90446034ef (patch)
treeb33d18158b62ad5d89cd35f4f547aadb509369e2 /examples/06_command_framework/src
parentFix command macro signatures (diff)
downloadserenity-18cc152769a35cd1705f045b9815cc90446034ef.tar.xz
serenity-18cc152769a35cd1705f045b9815cc90446034ef.zip
Implement context message queueing
Also the dreaded `ctx <<= "something"` which is actually a mistake.
Diffstat (limited to 'examples/06_command_framework/src')
-rw-r--r--examples/06_command_framework/src/main.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/06_command_framework/src/main.rs b/examples/06_command_framework/src/main.rs
index 4aeafe1..35a6994 100644
--- a/examples/06_command_framework/src/main.rs
+++ b/examples/06_command_framework/src/main.rs
@@ -81,9 +81,9 @@ fn main() {
let entry = counter.entry(command_name.clone()).or_insert(0);
*entry += 1;
- true
+ true // if `before` returns false, command processing doesn't happen.
})
- // Very similar to `before`, except this will be called directly _after_
+ // Similar to `before`, except will be called directly _after_
// command execution.
.after(|_, _, command_name, error| {
match error {
@@ -153,7 +153,7 @@ command!(commands(context, _msg, _args) {
// In this case, this command checks to ensure you are the owner of the message
// in order for the command to be executed. If the check fails, the command is
// not called.
-fn owner_check(_: &Context, message: &Message) -> bool {
+fn owner_check(_: &mut Context, message: &Message) -> bool {
// Replace 7 with your ID
message.author.id == 7
}