aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* Decode discriminators as stringsAustin Hellyer2016-11-172-9/+3
| | | | | While this will use a slightly higher amount of memory, it will be easier for users to use.
* Add a build decoder for u64s with a defaultAustin Hellyer2016-11-172-1/+6
| | | | | This will fix `ReadState`s failing to decode a `mention_count` if it is not present, as it may be optional. Default to `0`.
* 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`.
* Travis: allow nightly to failAustin Hellyer2016-11-151-0/+3
|
* Fix travis to install libsodiumAustin Hellyer2016-11-151-10/+16
|
* 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-1522-414/+1101
| | | | | | | | | | | | | | | 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.
* Embed Author: everything but 'name' is optionalAustin Hellyer2016-11-151-0/+2
| | | | | | | | | | | Fixes decoding the following embed snippet: ```json "author": { "url": "https://www.facebook.com/oneplusofficial/", "name": "OnePlus" } ```
* 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)); ```
* Feature-gate voice exampleAustin Hellyer2016-11-151-0/+14
| | | | | | When building without enabling the 'voice' feature, the voice example would fail. Instead, feature-gate it off so that it at least compiles with a "Voice not enabled" message.
* 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-146-17/+21
| | | | | | 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
|
* GitLab: test for voiceAustin Hellyer2016-11-141-1/+1
|
* Travis: Pass feature flag 'voice'Austin Hellyer2016-11-143-2/+3
|
* Add voice connection supportAustin Hellyer2016-11-1426-160/+1550
|
* Add internal moduleAustin Hellyer2016-11-1422-20/+21
| | | | | Create a general `internal` module, and move `prelude_internal` to `internal::prelude`.
* EmbedAuthor 'url' is optionalAustin Hellyer2016-11-141-0/+1
| | | | | | | | | | | | | | | This makes the `url` field of embed authors optional, as it is not required by the API. Example JSON snippet object which this fixes: ```json "author": { "proxy_icon_url": "https://images-ext-2.discordapp.net/eyJ1cmwiOiJodHRwczovL3R3ZW1vamkubWF4Y2RuLmNvbS8zNngzNi8xZjRkMS5wbmcifQ.ALs1I_Kui5vGLvxNrWqPmAkD-xc", "name": "FlexBot Server List - Page 1", "icon_url": "https://twemoji.maxcdn.com/36x36/1f4d1.png" } ```
* 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-104-11/+19
|
* Fix leave_guild endpointAustin Hellyer2016-11-101-2/+2
|
* Fix some clippy lintsAustin Hellyer2016-11-109-36/+13
|
* Implementing missing HTTP methodsAustin Hellyer2016-11-106-5/+119
| | | | | | | | | 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-094-3/+28
| | | | | | | | | | | | | | 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.
* Correctly decode Group channel IDsAustin Hellyer2016-11-091-0/+1
| | | | | | Group channel IDs are mapped from the `id` key. However, the YAML definition tried to map it to a `channel_id` field without a `from` key. The `from` key of `id` will properly map to `channel_id`.
* Add REST error code enumAustin Hellyer2016-11-091-0/+87
|
* Map op codes via a macroAustin Hellyer2016-11-094-66/+51
|
* Fix message decoding with reactionsAustin Hellyer2016-11-091-0/+1
| | | | | | | Messages in contexts other than MESSAGE_CREATE have a `reactions` field, which in turn has an `emoji` field, which is mapped by the build script to `reaction_type`. Add a `from` key to the YAML definition to perform this name conversion.
* Update URLs to docsAustin Hellyer2016-11-082-14/+16
|
* Fix README exampleAustin Hellyer2016-11-082-7/+15
|
* Framework: fix command arg positioningAustin Hellyer2016-11-083-47/+72
| | | | | | | | | | 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 Manage Webhooks to permissions 2FA listAustin Hellyer2016-11-081-0/+2
|
* Fix build script for optional defaulted u64sAustin Hellyer2016-11-082-1/+6
|
* Make all Embed fields except for 'kind' optionalAustin Hellyer2016-11-081-0/+7
| | | | | Embeds can return any combination - or a lack of - fields, so they need to all be optional, except for 'type'.
* Add doc modification scriptAustin Hellyer2016-11-071-0/+12
| | | | | | This is a script to modify the docs in some fashion. Right now it just adds an image to the header, but it will replace a couple of other things, in a nicer fashion.
* Add arguments to framework commandsAustin Hellyer2016-11-073-9/+14
|
* Re-order MessageType definitionAustin Hellyer2016-11-071-8/+8
|
* Register MessageType 6: PinsAddAustin Hellyer2016-11-071-0/+2
|