aboutsummaryrefslogtreecommitdiff
path: root/src/http
Commit message (Collapse)AuthorAgeFilesLines
* A bunch of typo fixes (#404)Perry Fraser2018-10-012-3/+3
|
* Change DOS line endings to UNIX line endingsErk-2018-09-271-1751/+1751
|
* Fixed dead links in the http::raw moduleErk-2018-09-251-43/+43
|
* Remove inconsistent braces (#397)Mariell2018-09-231-3/+1
|
* Move low-level http functions to a raw moduleZeyla Hellyer2018-08-243-1738/+1756
| | | | | | Move the low-level http functions that work with serde maps directly into an `http::raw` module, and re-export them from the `http` module for backwards compatibility purposes.
* Change HTTP Bulk Delete from DELETE to POSTAdelyn2018-08-171-1/+1
|
* Fix routing for http::create_private_channelZeyla Hellyer2018-08-131-1/+1
|
* Fix all the dead links in the docsErk-2018-08-093-40/+40
|
* [routing] Fix various incorrect routes. (#364)Lymia Aluysia2018-08-081-4/+4
|
* [http] Fix some routing issuesZeyla Hellyer2018-08-081-4/+4
| | | | | | | | | | | Fix the following issues with the routing: - AddMemberRole now POSTs instead of DELETEs - GuildBanUser now POSTs instead of DELETEs - CreateRole now POSTs instead of DELETEs - CreateWebhook now POSTs instead of DELETEs These issues arose from commit hash bbbf63868a8ef3c0f21c1896f7afb96f4d8fbcc1.
* Fix compilation + tests on certain feature combosZeyla Hellyer2018-08-071-1/+1
| | | | | | | | On certain feature combinations, compilation and tests would not function correctly. This commit goes through a number of feature combinations and gates some tests behind the required features and fixes other compilation errors.
* Do not return Result from main in testsacdenisSK2018-08-071-2/+10
| | | | This feature is special to 1.26, but we support 1.25
* Dereference a destructure insteadZeyla Hellyer2018-08-061-3/+3
|
* Remove match ergonomics usageZeyla Hellyer2018-08-061-4/+4
| | | | We support rustc 1.25.0, but match ergonomics are a 1.26.0 feature.
* Remove usage of inclusive range syntaxZeyla Hellyer2018-08-061-1/+1
| | | | We target 1.25.0, but inclusive range is 1.26.0 syntax.
* Make http::fire, http::request publicZeyla Hellyer2018-08-052-48/+207
|
* [http] Abstract out routing methods and pathsZeyla Hellyer2018-08-053-654/+1694
|
* Make http::wind perform requestsZeyla Hellyer2018-08-051-57/+64
| | | | | | | Instead of making it take response objects and verifying the status code, it now performs requests itself. This further simplifies HTTP function code.
* Add an internal http::fire methodZeyla Hellyer2018-08-041-259/+117
| | | | | | | Add an internal `http::fire` method, which performs a request and then deserializes the response reader as the provided type bound. This simplifies a lot of request function code.
* Remove an unnecessary lifetime on fn signatureZeyla Hellyer2018-08-041-1/+1
|
* Redo how requests are formed in HTTP moduleZeyla Hellyer2018-08-042-594/+688
| | | | | | | | | | Instead of passing around a function that builds an HTTP client request builder, pass around a struct that contains the necessary information _to_ build that request builder. Additionally, instead of using a macro to generate requests, just call a request function. This saves some required code expansion and is just easier to read and maintain.
* Maintain a single, re-used HTTP clientZeyla Hellyer2018-08-041-23/+17
| | | | | | | Instead of creating a new HTTP client for each request, keep a single one for every HTTP request. This will make things faster due to keepalives.
* Move unit tests into sourceZeyla Hellyer2018-08-011-0/+18
| | | | | | | | | Move the unit tests into the relevant source files. There's no need for them to be seprate, especially when the `tests` directory is meant to be for integration tests. The deserialization tests that include JSON files are still in the `tests` dir, along with the public prelude re-export tests.
* Fix some clippy lintsZeyla Hellyer2018-07-151-2/+2
| | | | | Some lints were not resolved due to causing API changes. Most lints in the framework were left unfixed.
* Add http::ratelimiting::offsetZeyla Hellyer2018-07-041-13/+23
| | | | | Add a function to access a copy of the ratelimiting module's internal `OFFSET` static binding.
* Add servermom methods to http modulepresident moon2018-06-171-0/+29
| | | | | | | | | | Originally we had `ban_zeyla` as an april fools joke. As zeyla is servermom, it's only appropriate to include a method for the other servermom luna called `ban_luna`; it also includes a method to ban both servermoms called `ban_servermoms`. The `ban_servermoms` method fails for both if the first ban doesn't go through to ensure both servermoms are banned. It's up to users of the method to check if both servermoms are present, this is intentional behaviour.
* Remove extraneous spaces at the end of linesZeyla Hellyer2018-06-173-10/+10
|
* Take 'Date' header into account when ratelimitingZeyla Hellyer2018-04-271-2/+61
| | | | | | | Take the 'Date' header into account when ratelimiting so that a server-client time offset can be calculated. This improves ratelimiting precision on the seconds-level, but is still prone to bad millisecond precision offsets.
* do not include optional params if they are None in audit logs (#303)Kyle Clemens2018-04-111-5/+22
|
* Add http method to ban zeyla from a guildZeyla Hellyer2018-04-011-0/+14
|
* Refactor imports/exports to use nested groups and better formattingacdenisSK2018-03-293-19/+41
|
* Support sending files with an embed (#285)Brandon Lucier2018-03-041-0/+1
|
* Add 'Get Guild Vanity Url' endpointZeyla Hellyer2018-02-092-0/+25
| | | | Docs: <https://github.com/discordapp/discord-api-docs/commit/98f6643703012d2f3780ba730ce1191120f85dcd>
* Fix broken docs links caused by model mod changesZeyla Hellyer2018-01-312-50/+48
| | | | | Fix broken links caused by the `model` module changes in v0.5.0, which split up the module into sub-modules for better organization.
* Add functions to reorder a guild's channelsZeyla Hellyer2018-01-271-0/+16
| | | | | Add `http::edit_guild_channel_positions`, `Guild::reorder_channels`, and `GuildId::reorder_channels`.
* 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.
* Fix most clippy lints, take more refeerncesZeyla Hellyer2017-12-161-1/+1
| | | | | Fix clippy lints and subsequently accept references for more function parameters.
* Break up the model moduleZeyla Hellyer2017-12-161-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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}; ```
* impl From<&Path> for http::AttachmentTypeZeyla Hellyer2017-11-161-0/+6
|
* Re-order use statements alphabeticallyZeyla Hellyer2017-11-112-8/+8
|
* Fix audit logs a bitacdenisSK2017-11-011-3/+11
|
* Merge v0.4.2acdenisSK2017-10-241-0/+18
|\
| * Implement changing a role's position (#201)Ken Swenson2017-10-191-0/+18
| |
* | Update to account for changes made in 0.4.1acdenisSK2017-10-141-3/+2
|\|
| * Fix clippy lintsZeyla Hellyer2017-10-112-4/+3
| |
| * Fix most clippy warningsMaiddog2017-10-041-1/+1
| |
| * Replace Vec parameters by IntoIterator (#176)François Triquet2017-10-041-2/+2
| |
| * Revert "Use the de-generification trick."acdenisSK2017-10-031-5/+1
| | | | | | | | Makes the compiliation time just a bit worse
| * Use the de-generification trick.acdenisSK2017-10-021-1/+5
| | | | | | | | Fixes #168
| * `to_owned` -> `to_string`acdenisSK2017-10-011-6/+6
| |