aboutsummaryrefslogtreecommitdiff
path: root/src/http
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'futures' into v0.6.xZeyla Hellyer2018-05-287-2055/+3295
|\
| * Use impl Trait for FuturesZeyla Hellyer2018-05-271-85/+85
| |
| * Add 'send_files' http supportZeyla Hellyer2018-03-262-95/+97
| |
| * Merge branch 'master' into futuresZeyla Hellyer2018-03-252-0/+37
| |\
| * | Remove `http::FutureResult`, use `error`'sZeyla Hellyer2018-03-251-3/+1
| | |
| * | Rewrite the library to use FuturesZeyla Hellyer2018-02-047-1961/+3205
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rewrites the library to use Futures. This rewrites all of the gateway, client, cache, most model methods, HTTP, and in a later commit the framework and voice. HTTP has been mostly rewritten to be ergonomic so that it can be used by the user, and has been upgraded to hyper v0.11. The gateway now uses `tokio-tungstenite` v0.4. The client isn't yet in a working state. The models now have a `client` optionally attached to them to make use of `http` and `cache`-utilizing methods. The client isn't needed, in the case that someone is using the library just to deserialize models. The cache is now built around `Rc`s and `RefCell`s, instead of `Arc`s and `RwLock`s. Refer to example 01 for a working example. Much of the library still doesn't work.
| * | Fix broken docs links caused by model mod changesZeyla Hellyer2018-02-042-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.
* | | Remove user account relation docs/functionsLakelezz2018-05-272-11/+3
| | | | | | | | | Remove functions and comment-segments relating to user-accounts.
* | | Permit sending files through the `CreateMessage` builder.Maid Dog2018-05-271-0/+1
| | |
* | | 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
| |
* | Switch to parking_lot::{Mutex, RwLock}Zeyla Hellyer2017-10-102-14/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Switch to the `parking_lot` crate's implementations of `std::sync::Mutex` and `std::sync::RwLock`, which are more efficient. A writeup on why `parking_lot` is more efficient can be read here: <https://github.com/Amanieu/parking_lot> Upgrade path: Modify `mutex.lock().unwrap()` usage to `mutex.lock()` (not needing to unwrap or handle a result), and `rwlock.read().unwrap()`/`rwlock.write().unwrap()` usage to `rwlock.read()` and `rwlock.write()`. For example, modify: ```rust use serenity::CACHE; println!("{}", CACHE.read().unwrap().user.id); ``` to: ```rust use serenity::CACHE; println!("{}", CACHE.read().user.id); ```
* | Make webhook_id a majour parameter in ratelimitingZeyla Hellyer2017-10-092-4/+19
| | | | | | | | | | This change is made due to this change in documentation: <https://github.com/discordapp/discord-api-docs/commit/32d06c360867cead6aa785ff10c437fdb2743bd6?short_path=5f625d6#diff-5f625d6c4303e22c3d6af4c8d6df28fe>
* | Fix most clippy warningsMaiddog2017-10-091-1/+1
| |
* | Replace Vec parameters by IntoIterator (#176)François Triquet2017-10-091-2/+2
| |
* | Revert "Use the de-generification trick."acdenisSK2017-10-091-5/+1
| | | | | | | | Makes the compiliation time just a bit worse
* | Use the de-generification trick.acdenisSK2017-10-091-1/+5
| | | | | | | | Fixes #168
* | `to_owned` -> `to_string`acdenisSK2017-10-091-6/+6
|/
* Document http::set_token and unhide it from docsZeyla Hellyer2017-09-231-3/+22
|
* Apply rustfmtZeyla Hellyer2017-09-182-69/+43
|
* Apply rustfmtZeyla Hellyer2017-09-181-1/+3
|
* Use combinators in `parse_header`acdenisSK2017-09-171-14/+7
|
* Update deprecated bulk delete endpointZeyla Hellyer2017-09-051-1/+1
| | | | | | | | | | | | The bulk delete endpoint of `/channels/:channel_id/messages/bulk_delete` was deprecated a while ago and was modified to `/channels/:channel_id/messages/bulk-delete`. New endpoint docs: <https://discordapp.com/developers/docs/resources/channel#bulk-delete-messages> Deprecated endpoint docs: <https://discordapp.com/developers/docs/resources/channel#bulk-delete-messages-deprecated>
* Remove more non-bot user endpointsZeyla Hellyer2017-09-011-47/+0
| | | | | | | | | | | | These include the following functions removed: - `http::get_application_info` - `http::get_applications` - `http::get_emoji` - `http::get_emojis` - `model::Guild::{emoji, emojis}` - `model::GuildId::{emoji, emojis}` - `model::PartialGuild::{emoji, emojis}`
* Add ability to play DCA and Opus files. (#148)Maiddog2017-08-272-46/+76
|
* Revamp `RwLock` usage in the libacdenisSK2017-08-242-76/+46
| | | | Also not quite sure if they goofed rustfmt or something, but its changes it did were a bit bizarre.
* Fix rustfmt lines that are too longZeyla Hellyer2017-08-181-1/+3
| | | | | Apparently rustfmt can't fix some of these, causing it to exit with 3 and therefore failing the build.
* Apply rustfmtZeyla Hellyer2017-08-182-35/+64
|
* Clippy and rustfmtacdenisSK2017-08-011-1/+2
|