| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
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.
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
| |
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.
|
| |
|
|
| |
This feature is special to 1.26, but we support 1.25
|
| |
|
|
| |
We target 1.25.0, but inclusive range is 1.26.0 syntax.
|
| | |
|
| | |
|
| |
|
|
|
|
|
| |
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` method, which performs a request and then
deserializes the response reader as the provided type bound.
This simplifies a lot of request function code.
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
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 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.
|
| |
|
|
|
| |
Some lints were not resolved due to causing API changes. Most lints in the
framework were left unfixed.
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
Docs: <https://github.com/discordapp/discord-api-docs/commit/98f6643703012d2f3780ba730ce1191120f85dcd>
|
| |
|
|
|
| |
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 `http::edit_guild_channel_positions`, `Guild::reorder_channels`, and
`GuildId::reorder_channels`.
|
| |
|
|
|
|
|
|
| |
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 clippy lints and subsequently accept references for more function
parameters.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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};
```
|
| | |
|
| | |
|
| | |
|
| |\ |
|
| | | |
|
| | | |
|
| | | |
|
| | |
| |
| |
| | |
Makes the compiliation time just a bit worse
|
| | |
| |
| |
| | |
Fixes #168
|
| | | |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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);
```
|
| | |
| |
| |
| |
| | |
This change is made due to this change in documentation:
<https://github.com/discordapp/discord-api-docs/commit/32d06c360867cead6aa785ff10c437fdb2743bd6?short_path=5f625d6#diff-5f625d6c4303e22c3d6af4c8d6df28fe>
|
| | | |
|
| | |
| |
| |
| | |
Makes the compiliation time just a bit worse
|
| | |
| |
| |
| | |
Fixes #168
|
| |/ |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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}`
|
| | |
|
| |
|
|
| |
Also not quite sure if they goofed rustfmt or something, but its changes it did were a bit bizarre.
|
| | |
|