| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| |\ \ |
|
| | |/ |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
Fix the return value of the function by properly checking whether the
user has the role in the given guild.
The function made the erraneous mistake of simply checking if the given
guild had the role by Id, not whether the _member in the given guild_
had the role by Id.
|
| | |
| |
| |
| |
| |
| |
| | |
* If a guild's emojis are being altered, Serenity will straight up use the new `HashMap` instead of just extending.
If `connect()` returns an `Err`, it will retry connecting.
Cleaned up `help_command.rs`.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Some methods on `model::Channel` are only for text channels. Methods on
Channel should be applicable to all channel types.
Deprecates the following methods on `model::Channel`:
- `create_reaction`
- `delete_message`
- `delete_reaction`
- `edit_message`
- `message`
- `messages`
- `reaction_users`
- `say`
- `send_files`
- `send_message`
- `unpin`
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | |
| |
| |
| |
| | |
It was voted that the `on_` prefix is unnecessary, so these have been
dropped.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
Change the `field` and `fields` methods on `builder::CreateEmbed` to not
accept a `CreateEmbedField` builder.
The embed field builder realistically only had (and most likely, only
will) have one optional argument, so the parameters may as well be on
`CreateEmbed::field`.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Builders would keep a `serde_json::Map<String, Value>`, which would
require re-creating owned strings for the same parameter multiple times
in some cases, depending on builder defaults and keying strategies.
This commit uses a `std::collections::HashMap<&'static str, Value>`
internally, and moves over values to a `serde_json::Map<String, Value>`
when it comes time to sending them to the appropriate `http` module
function.
This saves the number of heap-allocated string creations on most
builders, with specific performance increase on `builder::CreateMessage`
and `builder::CreateEmbed` & co.
|
| | | |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When Discord adds new features, the Feature enum will not be able to
serialize the new values until updated, causing the entire Guild
deserialization to fail.
Due to the fact that these features can be added at any time, the
`features` vector on Guild and PartialGuild have been changed to be a
`Vec<String>`.
Upgrade path:
Instead of matching on variants of Feature like so:
```rust
use serenity::model::Feature;
for feature in guild.features {
if feature == Feature::VipRegions {
// do work with this info
}
}
```
Instead opt to check the string name of the feature:
```rust
for feature in guild.features {
if feature == "VIP_REGIONS" {
// do work with this info
}
}
```
|
| |\| |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | |
| |
| |
| | |
`members_containing` and `members_starting_with` (#184)
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | |
| |
| | |
Fixes #174
|
| | | |
|
| | | |
|
| | |
| |
| |
| | |
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);
```
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Session invalidations include whether the session may be resumable.
Previously, this was not parsed by serenity. This data is now contained
in `GatewayEvent::InvalidateSession` as a boolean, which constitutes a
breaking change for users that manually handle gateway events.
Upgrade path:
Instead of pattern matching on simply the variant like so:
```rust
use serenity::model::event::GatewayEvent;
match gateway_event {
GatewayEvent::InvalidateSession => {
// work here
},
// other matching arms here
_ => {},
}
```
Instead pattern match it as a single field tuple-struct:
```rust
use serenity::model::event::GatewayEvent;
match gateway_event {
GatewayEvent::InvalidateSession(resumable) => {
// work here
},
// other matching arms here
_ => {},
}
```
|
| | | |
|
| | | |
|
| | |
| |
| |
| | |
`members_containing` and `members_starting_with` (#184)
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | |
| |
| | |
Fixes #174
|
| | | |
|
| | | |
|
| | |
| |
| |
| | |
Makes the compiliation time just a bit worse
|
| | |
| |
| |
| | |
Fixes #168
|
| | | |
|
| | | |
|
| |/ |
|
| |
|
|
|
| |
The output in a tag may result in "username#304" instead of the correct
"username#0304".
|