aboutsummaryrefslogtreecommitdiff
path: root/src/framework/mod.rs
Commit message (Collapse)AuthorAgeFilesLines
* Remove extraneous spaces at the end of linesZeyla Hellyer2018-06-171-1/+1
|
* Fix the framework example so that it makes sense and is runnableacdenisSK2018-05-051-6/+12
|
* Remove `is_bot` boolean from frameworkZeyla Hellyer2018-01-101-5/+5
| | | | | The framework no longer needs the `is_bot` boolean state, since serenity now only supports bot users.
* Break up the model moduleZeyla Hellyer2017-12-161-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `model` module has historically been one giant module re-exporting all of the model types, which is somewhere around 100 types. This can be a lot to look at for a new user and somewhat overwhelming, especially with a large number of fine-grained imports from the module. The module is now neatly split up into submodules, mostly like it has been internally since the early versions of the library. The submodules are: - application - channel - error - event - gateway - guild - id - invite - misc - permissions - prelude - user - voice - webhook Each submodule contains types that are "owned" by the module. For example, the `guild` submodule contains, but not limited to, Emoji, AuditLogsEntry, Role, and Member. `channel` contains, but not limited to, Attachment, Embed, Message, and Reaction. Upgrade path: Instead of glob importing the models via `use serenity::model::*;`, instead glob import via the prelude: ```rust use serenity::model::prelude::*; ``` Instead of importing from the root model module: ```rust use serenity::model::{Guild, Message, OnlineStatus, Role, User}; ``` instead import from the submodules like so: ```rust use serenity::model::channel::Message; use serenity::model::guild::{Guild, Role}; use serenity::model::user::{OnlineStatus, User}; ```
* Use the threadpool for framework command executionZeyla Hellyer2017-11-131-5/+6
| | | | | | | Instead of executing framework commands in the shard runner thread (potentially blocking the shard runner from reading new messages over the websocket and heartbeating), dispatch framework commands to the shard runner's threadpool.
* Use consistent token names in examplesZeyla Hellyer2017-11-011-1/+1
| | | | | The names of environment variable tokens in the examples differed, so this makes them all use the same name.
* Fix a few things with the framework traitacdenisSK2017-09-301-7/+23
|
* Remove tokio usageZeyla Hellyer2017-09-211-2/+1
|
* Fix tests (#145)Maiddog2017-08-221-2/+2
|
* Move builtin framework impl to its own moduleZeyla Hellyer2017-08-191-1023/+9
| | | | | | | | | | | | | | | | | The framework is now moved in its entirity to the `framework` module, with the `Framework` trait currently on its own and the builtin implementation provided. The builtin implementation has been renamed to "Standard". Upgrade path: Rename the `BuiltinFramework` import to `StandardFramework`. Instead of importing builtin framework items from `serenity::framework`, import them from `serenity::framework::standard`. This is the beginning to #60. The root `framework` module (non-standard implementation) will be built more by the time it's closed.
* Fix rustfmt lines that are too longZeyla Hellyer2017-08-181-6/+30
| | | | | Apparently rustfmt can't fix some of these, causing it to exit with 3 and therefore failing the build.
* Clippy lintsZeyla Hellyer2017-08-181-8/+12
|
* Apply rustfmtZeyla Hellyer2017-08-181-41/+67
|
* Move the Framework trait to the frameworkZeyla Hellyer2017-08-181-1/+18
|
* ClippyacdenisSK2017-08-191-2/+2
|
* Add a case for `context, message, args, full_message`acdenisSK2017-08-181-0/+8
|
* Allow the user to be given the original message (as in, the message used to ↵acdenisSK2017-08-181-10/+18
| | | | construct the `args`)
* Fix args when `use_quotes` is trueacdenisSK2017-08-181-1/+1
|
* Expande CheckFailed to provide Arc<Command>(#138)Lakelezz2017-08-171-2/+2
|
* Reword thisacdenisSK2017-08-161-1/+1
| | | | It already is filled, so this needed to be reworded a bit, but anyways, *facepalm for the unecessary issue creation*. Fixes #137
* Provide the args to the checksacdenisSK2017-08-161-7/+9
|
* Fix string delimiters (#134)Lakelezz2017-08-131-20/+22
|
* Trim a second time for a sakeacdenisSK2017-08-121-6/+8
|
* Rewamp the custom delimeter functionality to support moreacdenisSK2017-08-121-1/+6
|
* Add support for custom delimetersacdenisSK2017-08-121-1/+1
|
* Clippy and rustfmtacdenisSK2017-08-011-4/+5
|
* Fix failing tests (#133)Andrej2017-07-311-3/+3
|
* Remove a few clonesacdenisSK2017-07-291-1/+1
|
* Change the config a bit, and a few nitpicksacdenisSK2017-07-271-91/+85
|
* rustfmtacdenisSK2017-07-271-113/+163
|
* Make the `framework` module feature-gated and fix the names in the helper macroacdenisSK2017-07-271-15/+1
|
* Fix #130acdenisSK2017-07-221-201/+183
| | | | Removed action support from the builtin one as well, due to it adding some uneccassery complexity and it being only asked upon by one user
* Remove the uneccessary function and `Send + Sync` boundsacdenisSK2017-07-221-13/+5
|
* Make bucket checks less cache dependentacdenisSK2017-07-221-63/+76
|
* Implement adding checks to bucketsacdenisSK2017-07-151-14/+103
| | | | Don't ask about the horrendous code for this
* Switch to tokio for events (#122)Alex Lyon2017-07-141-4/+6
|
* Provide the command into the checksacdenisSK2017-07-131-1/+1
| | | | Although in the future, this will be changed to just bits of data of an actual command that wouldn't collide with the framework's code, but would still be useful for a check to use.
* Remove `checks_passed` in favour of the `Iterator::all` methodacdenisSK2017-07-041-11/+1
|
* Fix doc testsacdenisSK2017-07-021-23/+56
|
* Add reaction actions (#115)alex2017-06-281-1/+58
| | | Fixes #87
* Make CommandOrAlias and CommandGroup.commands public (#117)Joe K2017-06-281-1/+1
|
* Switch from #[doc(hidden)] to pub(crate)alex2017-06-141-6/+5
| | | | | | Switch from using `#[doc(hidden)]` to hide some internal functions to `pub(crate)`. The library now requires rustc 1.18.
* Make framework dynamic_prefix accept an &MessageZeyla Hellyer2017-06-131-1/+1
|
* Remove Context::{channel_id, queue}Zeyla Hellyer2017-06-131-1/+1
| | | | | | | | | The `channel_id` field on Context is no longer required internally, and is no longer of use to userland as event handlers are given the channel ID in some way where possible. `queue` is a remnant from when the Context was the primary way to interact with the REST API.
* Deprecate Client::login, add Client::newZeyla Hellyer2017-06-061-10/+10
|
* Clippy lintsZeyla Hellyer2017-06-061-12/+18
|
* Use chrono for struct timestamp fieldsZeyla Hellyer2017-06-061-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Chrono is easier to use than timestamped strings, so they should be automatically deserialized and available for the user, instead of having the user deserialize the strings themselves. These fields have been changed to use a type of `DateTime<FixedOffset>`: - `ChannelPinsUpdateEvent.last_pin_timestamp` - `Group.last_pin_timestamp` - `Guild.joined_at` - `GuildChannel.last_pin_timestamp` - `Invite.created_at` - `Member.joined_at` - `Message.edited_timestamp - `Message.timestamp` - `MessageUpdateEvent.edited_timestamp` - `MessageUpdateEvent.timestamp` - `PrivateChannel.last_pin_timestamp` `Member.joined_at` is now also an `Option`. Previously, if a Guild Member Update was received for a member not in the cache, a new Member would be instantiated with a default String value. This is incorrect behaviour, and has now been replaced with being set to `None` in that case. Id methods' `created_at()` method now return a `chrono::NaiveDateTime` instead of a `time::Timespec`, and `User::created_at` has been updated to reflect that. Additionally, drop `time` as a direct dependency and use chrono for internals.
* Add documentation and tests for frameworkMaiddog2017-05-301-0/+141
|
* Restructure modulesZeyla Hellyer2017-05-221-0/+665
Modules are now separated into a fashion where the library can be used for most use cases, without needing to compile the rest. The core of serenity, with no features enabled, contains only the struct (model) definitions, constants, and prelude. Models do not have most functions compiled in, as that is separated into the `model` feature. The `client` module has been split into 3 modules: `client`, `gateway`, and `http`. `http` contains functions to interact with the REST API. `gateway` contains the Shard to interact with the gateway, requiring `http` for retrieving the gateway URL. `client` requires both of the other features and acts as an abstracted interface over both the gateway and REST APIs, handling the event loop. The `builder` module has been separated from `utils`, and can now be optionally compiled in. It and the `http` feature are required by the `model` feature due to a large number of methods requiring access to them. `utils` now contains a number of utilities, such as the Colour struct, the `MessageBuilder`, and mention parsing functions. Each of the original `ext` modules are still featured, with `cache` not requiring any feature to be enabled, `framework` requiring the `client`, `model`, and `utils`, and `voice` requiring `gateway`. In total the features and their requirements are: - `builder`: none - `cache`: none - `client`: `gateway`, `http` - `framework`: `client`, `model`, `utils` - `gateway`: `http` - `http`: none - `model`: `builder`, `http` - `utils`: none - `voice`: `gateway` The default features are `builder`, `cache`, `client`, `framework`, `gateway`, `model`, `http`, and `utils`. To help with forwards compatibility, modules have been re-exported from their original locations.