aboutsummaryrefslogtreecommitdiff
path: root/src/ext/framework
Commit message (Collapse)AuthorAgeFilesLines
* Fix docs linksAustin Hellyer2017-01-243-11/+12
|
* Switch to a mostly-fully OOP approachAustin Hellyer2017-01-232-12/+11
| | | | | | The context is now strictly in relation to the context of the current channel related to the event, if any. See Context::say for a list of events that the context can be used for.
* First round of deleting useless methodsAustin Hellyer2017-01-151-6/+30
|
* hashmap of usagesTaavetti Sjelkov2017-01-021-1/+1
|
* Feature-flag a framework checkAustin Hellyer2017-01-021-5/+8
|
* Relisting 'Commands:' is redundant in embed helpAustin Hellyer2017-01-011-2/+0
|
* Implement context message queueingTaavi2017-01-016-36/+40
| | | Also the dreaded `ctx <<= "something"` which is actually a mistake.
* Fix command macro signaturesAustin Hellyer2016-12-311-4/+4
|
* Add command alias support and command.exampletaavi?2016-12-295-64/+155
|
* Use $crate in the command macroalex2016-12-241-4/+4
|
* Fix grammar in framework help the commandzeyla2016-12-211-1/+1
|
* Clarify command missing argument messageAustin Hellyer2016-12-191-1/+1
|
* Fix framework message position boundary splitsAustin Hellyer2016-12-181-18/+21
| | | | | | | The framework would take the length of the prefix in bytes, and then search for a command either directly after the byte length _and_ plus one for a command. Instead, ensure that the message is longer than the prefix.
* Default Framework command use_quotes to falseAustin Hellyer2016-12-181-1/+1
|
* Add framework config to ignore webhook messagesIllia2016-12-182-1/+23
|
* Fix framework before checkAustin Hellyer2016-12-181-1/+1
| | | | | | The framework would ignore the `before` function if the command was not ran by an owner. Instead, flip the conditions so that it's always run, and then the result is succeeded by an owner check.
* Fix framework command cooldownsAustin Hellyer2016-12-171-1/+1
|
* Remove cache feature dependency for frameworkAustin Hellyer2016-12-161-55/+65
|
* Framework: format argument number on parse errorIllia2016-12-161-2/+9
|
* Fix framework owners_only checkIllia2016-12-161-6/+8
|
* Plain help: put groups on their own lineAustin Hellyer2016-12-141-0/+2
|
* Fix plain help command usage outputAustin Hellyer2016-12-141-0/+2
|
* Framework blocks, disabled commands, improvementsIllia2016-12-144-48/+205
|
* Slightly rework framework bucketsAustin Hellyer2016-12-146-207/+200
|
* Implement command groups and bucketsIllia2016-12-137-81/+703
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Implement command groups * change to ref mut * Implement framework API. * Remove commands field * Make it all work * Make example use command groups * Requested changes * Implement adding buckets * Add ratelimit check function * Finish everything * Fix voice example * Actually fix it * Fix doc tests * Switch to result * Savage examples * Fix docs * Fixes * Accidental push * 👀 * Fix an example * fix some example * Small cleanup * Abstract ratelimit bucket logic
* More config for CreateCommand, add various methodsIllia2016-12-104-2/+157
| | | | | | | | | | | | | | | | | | | | | | | | | | Adds multiple configurations to the command builder, and adds methods to various structs. Context::get_current_user is a shortcut to retrieve the current user from the cache. Message::get_member retrieves the member object of the message, if sent in a guild. Message::is_private checks if the message was sent in a Group or PrivateChannel. User::member retrieves the user's member object in a guild by Id; Adds 6 configurations to the command builder: - dm_only: whether the command can only be used in direct messages; - guild_only: whether the command can only be used in guilds; - help_available: whether the command should be displayed in the help list; - max_args: specify the maximum number of arguments a command must be given; - min_args: specify the minimum number of arguments a command must be given; - required_permissions: the permissions a member must have to be able to use the command;
* Abstract command fields to typesAustin Hellyer2016-12-093-14/+20
|
* Command builder, quoted args, and multi-prefixesIllia2016-12-094-32/+278
| | | | | Add a command builder, which can take arguments such as multiple checks, quoted arguments, and multiple prefix support, as well as dynamic prefixes per context.
* Make command macro functions publicAustin Hellyer2016-11-301-2/+2
| | | | This will allow the command macro to be used in sub-modules.
* Clarify some docsAustin Hellyer2016-11-301-1/+1
|
* Clean up the codebaseAustin Hellyer2016-11-292-39/+8
|
* Fix doctestsAustin Hellyer2016-11-281-3/+3
|
* Add before/after framework command hooksIllia K2016-11-282-5/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-263-0/+122
|
* Add no-named-argument command macro matchAustin Hellyer2016-11-261-1/+37
|
* Move events into their own moduleAustin Hellyer2016-11-251-1/+1
| | | | | | | | | | | | | | | | | | | | The events were cluttering the `model` module, and so are now moved into their own `model::event` module. As users should not usually have to work with events all that much - only currently in some rarely used event handlers - this change should not be much more effort to import from. i.e.: ```rs use serenity::model::event::ChannelPinsAckEvent; ``` vs. the now-old: ```rs use serenity::model::ChannelPinsAckEvent; ```
* Rename the `http` module to `rest`Austin Hellyer2016-11-251-2/+2
|
* Add framework command named argumentsAustin Hellyer2016-11-211-0/+23
|
* A bit of docsAustin Hellyer2016-11-182-5/+116
|
* Fix some clippy lintsAustin Hellyer2016-11-101-16/+2
|
* Framework: fix command arg positioningAustin Hellyer2016-11-082-46/+71
| | | | | | | | | | 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-072-3/+8
|
* Add an 'allow_whitespace' framework configAustin Hellyer2016-11-062-31/+84
| | | | | | | | | | | | | | The option allows whitespace to be optional between a mention and a command. Setting it to true will allow the following scenario to occur, while false will not: ``` <@BOT_ID>about // bot process and executes the "about" command if it exists ```
* Allow non-prefixed mentionsAustin Hellyer2016-11-061-15/+20
| | | | | Allow frameworks to be made and dispatched to that listen for mentions, but not for prefixes.
* Initial commitAustin Hellyer2016-10-183-0/+177