| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| | |
|
| | |
|
| |
|
|
|
|
| |
Instead of calling `parking_lot::RwLock::read` on the member's guild,
call `parking_lot::RwLock::try_read` and return None early if it would
cause a deadlock.
|
| |
|
|
|
| |
Implementation `From<CurrentUser> for User` and `From<&'a CurrentUser>
for User`.
|
| | |
|
| |
|
|
|
| |
Adds the `Message::member` structfield, which contains a partial amount
of member data (deaf and mute status, role IDs, and joined_at).
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
| |
This makes them easier to be found by tools like rls.
Also update struct inits to use the shorthand version for `x: x`.
|
| | |
|
| | |
|
| |
|
|
| |
This brings the function in line with the 'tag' function for User models,
and with the official Discord app experience and other libraries.
|
| |
|
|
| |
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.
|
| | |
|
| |
|
|
|
|
| |
When creating a new role, correctly set its position if a position was
specified. This is because the "Create Role" endpoint no longer accepts
a `position` key.
|
| |
|
|
|
| |
Add `http::edit_guild_channel_positions`, `Guild::reorder_channels`, and
`GuildId::reorder_channels`.
|
| |
|
|
|
|
| |
In models' `delete_messages` methods, check the number of messages being
deleted. If 0 or more than 100, return a `ModelError::BulkDeleteAmount`,
as this amount would result in an invalid request.
|
| |
|
|
|
|
|
|
|
| |
Add a `member` function on `model::channel::Message` to retrieve a clone
of the author's Member instance in the channel's guild.
If the message was not sent in a guild, the guild could not be found in
the cache, or the member instance could not be found in the cache, then
`None` is returned.
|
| |
|
|
|
|
| |
When using `Guild::greater_member_hierarchy`, check if both user IDs are
the same (returning None) or if one of them is the guild owner, in which
case the guild owner's ID is returned.
|
| | |
|
| | |
|
| |
|
|
|
|
| |
When editing messages, not all fields are applicable. Attachments, TTS,
and reactions are not applicable. To help with this distinction,
separate message editing into a different builder.
|
| |
|
|
|
|
|
|
| |
If a presence update for a guild comes in and their associated member
instance is not present (e.g. in a large guild that wasn't member
chunked), then create one with the infomation known out of the presence
update. This includes their user information, guild ID, nickname, and
roles, but not their `deaf`, `joined_at`, and `mute` state.
|
| | |
|
| |
|
|
|
|
|
|
| |
Update the docs for `User::has_role` to reflect that
`Into<GuildContainer>` is only implemented for `PartialGuild`,
`GuildId`, and `u64`, not `Guild`.
(cherry picked from commit 00deef894ec458ac8abff914ed864ea63c47eda6)
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
| |
Add a function to determine which of two members has the higher
role hierarchy.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Further generic-ify the `after` parameter on the `reaction_users` method
of the following structs:
- `ChannelId`
- `Group`
- `GuildChannel`
- `Message`
- `Channel`
- `GuildChannel`
Do this by changing the `U` trait bound from `Into<UserId>` to
`Into<Option<UserId>>`.
This resolves problems determining types when passing `None` as the
argument, as reported in #247.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
While building permissions in the `Guild::permissions_in` function -
which is relied upon by most model functions to check CurrentUser
permissions - the channel overwrites of the given channel were iterated
over incorrectly.
The channel overwrites were iterated over in a non-specified order,
resulting in overwrites being applied in a random order. However,
Discord operates by applying permissions from a down-top order: role ID
0 is below role ID 1, which is below role ID 2, etc. This means that
prior to applying permissions we must first sort by position so that
lower positioned roles are iterated over first.
|
| |
|
|
|
|
| |
According to [this commit], the game type has been removed.
[this commit]: https://github.com/discordapp/discord-api-docs/commit/50999182f307ffda9ac7208a48570586ea446c08#diff-b307d936b736f302bc7cc153f0d8a0a3L779
|
| |
|
|
| |
This also fixes no-builder compilation
|
| | |
|
| |
|
|
|
|
|
| |
Add missing 'num' implementations from the following models:
- `channel::{ChannelType, MessageType}`
- `gateway::GameType`
|
| |
|
|
|
|
| |
By negating hashing altogether.
The increase is around 1000-ish nanoseconds saved.
|
| |
|
|
|
|
|
| |
Use rfind, in case there's more '#' in username than just the discriminator
Split at pos+1 instead of pos and remove the trailing '#' in the split.0 (Name)
Fix bug with parsing
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
Adds an animated structfield to `Emoji` and `ReactionType`'s `Custom`
variant, which defaults to false if not present.
A test has been added for deserializing it, taken from a REST API GET
Emojis response.
(cherry picked from commit 5286949f424e824784344ebb7b7af4e52fb819c3)
|
| | |
|
| |
|
|
|
| |
This commit makes GatewayEvent no longer unwrap Dispatch
deserializations, and instead Try? it away.
|
| |
|
|
|
|
|
| |
Fix the deserialization of `model::guild::Guild` when
`Guild::system_channel_id` is not present.
Additionally, add a test case for this.
|