aboutsummaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
* Add `Client::user_id`Zeyla Hellyer2018-01-101-3/+10
| | | | | Add the user ID to the client. This can be used when initializing the framework on connection start, as well as the future voice manager.
* Fix docs for User::has_roleNikita Pekin2018-01-101-3/+4
| | | | | | | | Update the docs for `User::has_role` to reflect that `Into<GuildContainer>` is only implemented for `PartialGuild`, `GuildId`, and `u64`, not `Guild`. (cherry picked from commit 00deef894ec458ac8abff914ed864ea63c47eda6)
* Remove `is_bot` boolean from frameworkZeyla Hellyer2018-01-103-9/+9
| | | | | The framework no longer needs the `is_bot` boolean state, since serenity now only supports bot users.
* Add missing `correct roles`-checks in help-commands (#249)Lakelezz2018-01-102-4/+62
|
* Allow channels to be moved in and out of a category (#248)Kyle Clemens2018-01-084-8/+30
|
* Fix compilationZeyla Hellyer2018-01-062-6/+5
|
* Add some role position hierarchy checksZeyla Hellyer2018-01-063-8/+36
|
* Add Guild::greater_member_hierarchyZeyla Hellyer2018-01-061-0/+47
| | | | | Add a function to determine which of two members has the higher role hierarchy.
* Add Member::highest_role_infoZeyla Hellyer2018-01-061-0/+40
|
* Compare Instants in Shard::latencyZeyla Hellyer2018-01-061-4/+6
| | | | | | | When calculating the latency between when a heartbeat was sent and a heartbeat acknowledgement was received, ensure that the heartbeat acknowledgement was received after the heartbeat was sent. This avoids a panic. Otherwise, return None.
* Further generic-ify `reaction_users` `after` paramZeyla Hellyer2018-01-056-49/+52
| | | | | | | | | | | | | | | | | | Further generic-ify the `after` parameter on the `reaction_users` method of the following structs: - `ChannelId` - `Group` - `GuildChannel` - `Message` - `Channel` - `GuildChannel` Do this by changing the `U` trait bound from `Into<UserId>` to `Into<Option<UserId>>`. This resolves problems determining types when passing `None` as the argument, as reported in #247.
* Fix permission overwrites in permission buildingZeyla Hellyer2018-01-051-1/+11
| | | | | | | | | | | | | | While building permissions in the `Guild::permissions_in` function - which is relied upon by most model functions to check CurrentUser permissions - the channel overwrites of the given channel were iterated over incorrectly. The channel overwrites were iterated over in a non-specified order, resulting in overwrites being applied in a random order. However, Discord operates by applying permissions from a down-top order: role ID 0 is below role ID 1, which is below role ID 2, etc. This means that prior to applying permissions we must first sort by position so that lower positioned roles are iterated over first.
* Fix help-commands' `plain`Lakelezz2018-01-061-4/+37
|
* Convert embed footers for CreateEmbed::from (#244)Derrick Lee2018-01-041-0/+12
|
* Remove GameType::WatchingZeyla Hellyer2018-01-031-32/+0
| | | | | | According to [this commit], the game type has been removed. [this commit]: https://github.com/discordapp/discord-api-docs/commit/50999182f307ffda9ac7208a48570586ea446c08#diff-b307d936b736f302bc7cc153f0d8a0a3L779
* Move `VecMap` to `utils`acdenisSK2018-01-0217-24/+21
| | | | This also fixes no-builder compilation
* Remove builder re-export in utilsZeyla Hellyer2018-01-023-6/+2
|
* Resolve no-framework client compilationZeyla Hellyer2018-01-021-2/+2
|
* Update dispatch.rsZeyla Hellyer2018-01-021-1/+1
|
* Fix no-framework dispatchingZeyla Hellyer2018-01-021-1/+1
|
* Implement or derive Serialize on all modelsZeyla Hellyer2018-01-0126-115/+442
|
* Give hyper Response in HTTP errorsZeyla Hellyer2018-01-012-32/+15
| | | | | | | | Remove the `Error::UnknownStatus` variant, and change `Error::InvalidRequest(StatusCode)` to `Error::UnsuccessfulRequest(hyper::Response)`. This is done to give the user more information on why a request was unsuccessful, as before the user did not have access to the response body or headers.
* Add an event for shard updatesZeyla Hellyer2018-01-016-47/+106
| | | | | Add an event in the EventHandler to be called when a shard updates its Connection Stage.
* Expose a method of retrieving shard status/latencyZeyla Hellyer2018-01-014-1/+52
| | | | | | This exposes a method of retrieving a shard's status and latency through the Shard Manager, as part of the existing Shard Runner Info struct. The Shard Runner will update this whenever it notices a change.
* Derive Hash, impl Display on ConnectionStageZeyla Hellyer2018-01-011-1/+17
| | | | Implement `Display` and derive `Hash` on `gateway::ConnectionStage`.
* Add missing 'num' implementations on modelsZeyla Hellyer2017-12-273-0/+40
| | | | | | | Add missing 'num' implementations from the following models: - `channel::{ChannelType, MessageType}` - `gateway::GameType`
* Improve performance of builders even furtheracdenisSK2017-12-2724-65/+200
| | | | | | By negating hashing altogether. The increase is around 1000-ish nanoseconds saved.
* Fix Guild::member_named and add teststahahawa2017-12-241-8/+15
| | | | | | | Use rfind, in case there's more '#' in username than just the discriminator Split at pos+1 instead of pos and remove the trailing '#' in the split.0 (Name) Fix bug with parsing
* Add `iter_quoted`acdenisSK2017-12-241-10/+28
|
* Fix `multiple_quoted` (#241)Lakelezz2017-12-241-50/+50
|
* Update model to include new voice regions (#240)Ken Swenson2017-12-231-0/+8
|
* Better support for multiple delimiters on `Args` (#239)Lakelezz2017-12-223-160/+246
|
* Add `animated` to `Emoji` and `ReactionType`Zeyla Hellyer2017-12-203-2/+29
| | | | | | | | | | Adds an animated structfield to `Emoji` and `ReactionType`'s `Custom` variant, which defaults to false if not present. A test has been added for deserializing it, taken from a REST API GET Emojis response. (cherry picked from commit 5286949f424e824784344ebb7b7af4e52fb819c3)
* Add variant adapters to Channel (#238)Timo2017-12-201-0/+133
|
* GatewayEvent: don't unwrap deserializationsZeyla Hellyer2017-12-191-1/+2
| | | | | This commit makes GatewayEvent no longer unwrap Dispatch deserializations, and instead Try? it away.
* Actually fix `Args`'s `parse` and add a few tests (#236)Lakelezz2017-12-181-8/+3
|
* Fix ifsacdenisSK2017-12-181-6/+6
|
* Fix multiple char delimitersacdenisSK2017-12-181-4/+9
|
* Add a special `len` to `Args`acdenisSK2017-12-182-6/+23
|
* Fix `Guild` deser without `system_channel_id`Zeyla Hellyer2017-12-171-4/+4
| | | | | | | Fix the deserialization of `model::guild::Guild` when `Guild::system_channel_id` is not present. Additionally, add a test case for this.
* Default serde on a couple Ready structfieldsZeyla Hellyer2017-12-171-6/+8
| | | | | | | Have serde default on the `presences` and `private_channels` structfields of `Ready`. Some JSON serializers might leave these out when serializing if they're empty, so resolve this by simply defaulting to empty maps.
* Fix typo (#235)Lakelezz2017-12-171-1/+1
|
* Add missing trailing comma in matchZeyla Hellyer2017-12-171-1/+1
|
* Trim given token in Client::newZeyla Hellyer2017-12-171-0/+2
| | | | | Trims the token given as an argument in Client::new, which will strip away whitespace that might occur due to including the token from a file.
* Fix doc-tests and `single_zc`acdenisSK2017-12-174-26/+28
|
* Fix shards attempting to re-identify on their ownZeyla Hellyer2017-12-163-35/+51
| | | | | | | | | | Fix shards by taking away their responsibility to re-identify, instead shutting down shard runners and going through the shard queuer to restart a shard runner and its associated shard. This fixes the case where a running shard's session invalidates and re-IDENTIFYs within 5 seconds before queued shard starts, causing a cascading failure of sessions for new shards.
* Avoid an unwrap in args::parse_quotesZeyla Hellyer2017-12-161-1/+1
|
* Fix most clippy lints, take more refeerncesZeyla Hellyer2017-12-1616-108/+117
| | | | | Fix clippy lints and subsequently accept references for more function parameters.
* Fix voice feature compilationZeyla Hellyer2017-12-165-5/+6
|
* Attempt to restart failed shard bootsZeyla Hellyer2017-12-162-18/+48
| | | | | | | | | | | | When the ShardQueuer fails to restart a shard (such as due to a network error, an issue on Discord's side, Cloudflare, etc.), it will now push the ID onto a queue. Every 5 seconds messages will attempt to be read from the receiver, and if one is not read after the timeout, a queued shard start will occur (if one is queued). This should fix a number of reconnection issues.