aboutsummaryrefslogtreecommitdiff
path: root/src/ext/framework/command.rs
Commit message (Collapse)AuthorAgeFilesLines
* Clean up the codebaseAustin Hellyer2016-11-291-8/+7
|
* Add before/after framework command hooksIllia K2016-11-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These hooks will each be run prior to or after the command, and will finish execution before executing the command. These can be configured in a Framework via: ```rs client.with_framework(|f| f .before(|_context, message, _command_name| { println!("Got command '{}'", command_name); }) .after(|_context, _message, command_name| { println!("Finished command '{}'", command_name); })); ``` This does introduce a backwards compatibility break, by requiring commands' Context/Message to be borrowed Upgrade path: If not using the `command!` macro, modify command signatures from: ```rs fn some_command(context: Context, message: Message, args: Vec<String>) ``` to ```rs fn some_command(context: &Context, message: &Message, args: Vec<String>) ```
* Add a bit more docsAustin Hellyer2016-11-261-0/+1
|
* Framework: fix command arg positioningAustin Hellyer2016-11-081-0/+55
| | | | | | | | | | The command system assumed that prefixes were only one character long, so count the total length of the prefix. In addition, the `allow_whitespace` configuration added some difficulty in deciding where to count as the initial position to start splitting for arguments. Instead of fixing that, rewrite the framework to make these types of changes easier in the future.
* Add arguments to framework commandsAustin Hellyer2016-11-071-1/+1
|
* Initial commitAustin Hellyer2016-10-181-0/+7