aboutsummaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
* Add framework command named argumentsAustin Hellyer2016-11-211-0/+23
|
* No-run on context doc exampleAustin Hellyer2016-11-201-1/+1
|
* Add methods for setting individual presence dataAustin Hellyer2016-11-202-6/+103
|
* Fix context doctestsAustin Hellyer2016-11-201-4/+4
|
* Add Member::roles()Austin Hellyer2016-11-201-0/+20
| | | | | | | The roles method will search through the state and find full role data for the member. This is essentially a shorthand for it. This does perform a clone of the role data, but this will be optimized in the future.
* Rework contextual presence methodsAustin Hellyer2016-11-192-14/+77
| | | | | | | | | Rework the methods to accept strings and games directly, rather than Optional values. Instead, use the new `reset_presence` to set a clean status, or `set_presence` for more fine-grained control. In addition, `Game::playing` and `Game::streaming` now accept `&str`s rather than Strings.
* Rename state methods from find_ to get_Austin Hellyer2016-11-197-23/+22
| | | | | | | | | | For consistency with the rest of the library, rename the methods prefixed with `find_` to `get_`. The past logic was that items are "found", as they may or may not exist. With get, the expectation is that it is _always_ there, i.e. over REST. However, this is inconsistent, and "get"ting over REST can fail for other reasons.
* Fix type errors for non-framework buildsAustin Hellyer2016-11-192-5/+13
|
* Nonblocking connectionAustin Hellyer2016-11-193-81/+70
| | | | | | | | | | | The connection is now non-blocking, allowing user event handlers to immediately unlock it themselves (assuming they haven't unlocked it elsewhere), rather than waiting on the library to receive an event. This is done by decoupling the receiver away from the connection, which is not necessarily "directly" associated with the connection. This needs a _lot_ of code cleanup later.
* Fix cond. compile across multiple feature targetsAustin Hellyer2016-11-196-164/+239
| | | | | | | | Fixes conditional compilation across multiple combinations of feature targets, where it was assumed a second feature would be enabled by something that requires a feature to be enabled. This also fixes an EOF compilation error on no-feature builds.
* Don't send embed on message edits if emptyAustin Hellyer2016-11-192-6/+10
|
* Add PublicChannel::guild()Austin Hellyer2016-11-191-0/+9
| | | | | This will search the state for the channel's associated guild, acting as a shortcut.
* Add GuildId::to_channelAustin Hellyer2016-11-181-0/+8
|
* Add Context::set_game_nameAustin Hellyer2016-11-181-0/+18
|
* Register friend suggestion eventsAustin Hellyer2016-11-185-0/+71
|
* A bit of docsAustin Hellyer2016-11-1819-186/+1045
|
* Feature macros should use else as block separatorAustin Hellyer2016-11-183-8/+8
|
* Ratelimiting: don't attempt to RL for NoneAustin Hellyer2016-11-181-14/+18
| | | | | | Some routes, mostly user-specific ones, do not have ratelimit headers. So when specifying the `Route::None` variant, do not attempt to treat it as its own bucket, and instead ignore ratelimiting for it.
* Allow Id/u64 equality comparisonsAustin Hellyer2016-11-171-1/+13
| | | | | | | | | | | | | | This will allow comparing, for example, a `ChannelId` with a `u64` directly, bypassing the need to do something like: ```rust let channel_id = ChannelId(7); assert!(channel_id.0 == 7); // can now be replaced with: assert!(channel_id == 7); ```
* Decode discriminators as stringsAustin Hellyer2016-11-171-7/+2
| | | | | While this will use a slightly higher amount of memory, it will be easier for users to use.
* Add DELETE/PUT guild member roleAustin Hellyer2016-11-163-5/+73
| | | | | | | | | | Adds support for `DELETE /guilds/:guild_id/members/:user_id/roles/:role_id` and `PUT /guilds/:guild_id/members/:user_id/roles/:role_id`, which are routes to add or remove individual roles to a guild member. The `Member::add_role` and `Member::remove_role` methods will edit in-place.
* Accepting invites only works for user accountsAustin Hellyer2016-11-162-3/+59
| | | | | They do not work for bot users. So return a `ClientError::InvalidOperationAsBot` if someone tries to.
* Add Colour::from_rgbAustin Hellyer2016-11-161-0/+34
| | | | | from_rgb creates a `Colour` from an RGB representation. This is meant as the "opposite" usage of `Colour::new`.
* Fix a few clippy lintsAustin Hellyer2016-11-151-8/+9
|
* Add message edit/edit_message rich embedsAustin Hellyer2016-11-152-7/+27
|
* Add send_message rich embedsAustin Hellyer2016-11-156-29/+442
|
* Add state/framework/etc. conditional compile flagsAustin Hellyer2016-11-1521-413/+1096
| | | | | | | | | | | | | | | This adds conditional compilation for the following features, in addition to the voice conditional compilation flag: - extras (message builder) - framework - methods - state These 4 are enabled _by default_, while the `voice` feature flag is disabled. Disabling the state will allow incredibly low-memory bots.
* Add a message builder for Context::send_messageAustin Hellyer2016-11-154-15/+89
| | | | | | | | | | | | | | | | Add a message builder to `send_message`. Often only one field - i.e. `content` - needs to be specified, and the rest can be ignored. This is a preliminary patch to add rich embed support to messages. This message builder is used via: ```rust // assuming in a context with a `channel_id` bound context.send_message(channel_id, |m| m .content("TTS ping!") .tts(true)); ```
* State: on update, return old instancesAustin Hellyer2016-11-154-148/+236
| | | | | | | | | When updating the State, return the old instance of removed/updated fields where possible, so that they can be used to send to event handlers as a "this is what it used to look like, this is what it looks like now" type of thing. Very descriptive, I know.
* Decode embed/role colours into Colour structAustin Hellyer2016-11-144-11/+14
| | | | | | This is for a little bit of ergonomics, and is of such a minute cost that it is worth it to just directly decode the u32's received for Role/Embed colours into the Colour struct.
* Allow current user to nickname themselvesAustin Hellyer2016-11-144-0/+69
| | | | | | | | | | | | | | | | | | Add support for the `PATCH /guilds/:guild_id/members/@me/nick` endpoint, which allows the current user to edit their own nickname. A user can only nickname themselves if they have the `Change Nickname` permission. This adds 4 methods: - `serenity::client::http::edit_nickname`; - `serenity::client::Context::edit_nickname`; - `serenity::model::Guild::edit_nickname`; - `serenity::model::LiveGuild::edit_nickname`. `LiveGuild`'s implementation checks for whether the current user has permission to change their own nickname.
* Add missing permission shorthandsAustin Hellyer2016-11-141-0/+16
|
* Add voice connection supportAustin Hellyer2016-11-1424-159/+1366
|
* Add internal moduleAustin Hellyer2016-11-1422-20/+21
| | | | | Create a general `internal` module, and move `prelude_internal` to `internal::prelude`.
* Move the builders to the utilsAustin Hellyer2016-11-1317-609/+643
| | | | | | | | | The builders aren't a large enough portion of the library to deserve their own root-level module, so move them to the `utils` module. Additionally, split them into separate files, as the library will be receiving more builders and the single-file pattern was getting rather large.
* Don't overflow on message length checkAustin Hellyer2016-11-121-3/+3
|
* Add a check for message content lengthAustin Hellyer2016-11-124-7/+129
| | | | | | | | | | Before sending a request to Discord, ensure that a message's content on non-HTTP functions and methods meets the required length. If it exceeds the limit, then return a `Error::Client(ClientError::MessageTooLong(u64))`, containing the number of unicode code points exceeding the limit. Note that directly using the HTTP methods does not impose this limit.
* Add delete_message_reactions + register eventAustin Hellyer2016-11-117-2/+95
| | | | | | | | | Add the `delete_message_reactions` endpoint (`DELETE /channels/{}/messages/{}/reactions`) and implement a method on the `Message` struct for easy access, `delete_reactions`. Register the `MESSAGE_REACTION_REMOVE_ALL` event and add an event handler.
* Add a clippy configAustin Hellyer2016-11-103-11/+11
|
* Fix leave_guild endpointAustin Hellyer2016-11-101-2/+2
|
* Fix some clippy lintsAustin Hellyer2016-11-108-36/+10
|
* Implementing missing HTTP methodsAustin Hellyer2016-11-102-5/+36
| | | | | | | | | The missing HTTP methods are: - get_guild_integrations: `GET /guilds/:guild_id/integrations - get_guild_regions: `GET /guilds/:guild_id/regions` - get_user_connections: `GET /users/@me/connections` - get_user_dm_channels: `GET /users/@me/channels`
* Fix ratelimit bucket for start_integration_syncAustin Hellyer2016-11-101-1/+1
|
* slice_patterns is not stableAustin Hellyer2016-11-102-6/+5
|
* Properly shutdown on connection DropAustin Hellyer2016-11-102-0/+25
|
* Correctly shutdown the connectionAustin Hellyer2016-11-101-5/+13
| | | | Rather than completely dropping the connection, send a close code prior.
* Add a Feature enumAustin Hellyer2016-11-091-1/+1
| | | | | | | | | | | | | | Features are handed by Discord to guilds that meet requirements which are most likely realistically arbitrary. The 3 features at this moment are: - INVITE_SPLASH - VANITY_URL - VIP_REGIONS On decoding of the two guild structs, map these string values to enum variants.
* Add REST error code enumAustin Hellyer2016-11-091-0/+87
|
* Map op codes via a macroAustin Hellyer2016-11-094-66/+51
|
* Fix README exampleAustin Hellyer2016-11-081-4/+8
|