| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| | |
|
| | |
|
| |
|
|
|
| |
Fix broken links caused by the `model` module changes in v0.5.0, which
split up the module into sub-modules for better organization.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Fix Speaking state, use latest voice API version
* Speaking state would remain stuck on after playing particularly long
stretches of audio. So far as I can tell, playing 5 frames of silence
BEFORE changing the state seems to do the trick.
* Added new constant to make sure the library uses v3 of the voice api,
which it is written for.
* Heartbeat interval adjusted by * .75 as recommended by Discord.
* Initial version of new Audio wrapper.
* Single audio file case, as before..
* Loop over all available audio samples.
* Combine audio streams, account for volume.
* Cheaper explicit Opus silence frames.
As per Discord's recommendation, use a well-known 3-byte silence frame when needed.
* A bit of cleanup
Cleanup some of the code, rename some short-form fields to longer forms
(e.g. `s/src/source`), and remove a breaking change.
`Handler::play` was changed to return `LockedAudio` instead of `()`. If
someone were to rely on `Handler::play` returning `()`, the return type
change would break their code. Instead, this functionality has been
added to a new `Handler::play_returning` function.
|
| | |
|
| |
|
|
|
| |
Technically a bugfix because this made it sort of unusable; instead,
users need to explicitly `Some(Box::new(receiver))`.
|
| | |
|
| |
|
|
|
|
| |
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.
|
| | |
|
| |
|
|
|
|
|
| |
The websocket loop for voice events is terminated whenever a websocket
message is successfully sent. This is caused by a bug that was
introduced in
https://github.com/zeyla/serenity/commit/c8536c111117f26833fb1bceff734ac1abc55479#diff-6a8a0bad68abd05790cdc2c2ba043ec6L457,
due to an improperly implemented clippy lint.
|
| |
|
|
|
| |
Add code to strip RTP header extensions from an incoming voice stream,
if they are present.
See https://tools.ietf.org/html/rfc5285 for more info.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
| |
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.
|
| | |
|
| | |
|
| |
|
|
|
|
|
| |
Instead of communicating over the gateway in a split form of a
`serde_json::Value` or a `client::bridge::gateway::ShardClientMessage`,
wrap them both into a single enum for better interaction between the
client, gateway, and voice modules.
|
| |
|
|
|
|
|
|
| |
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.
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
| |
This reverts commit 062ea86d5b0d9932207636d4a44a5357b079e79a.
This change had the unintended side-effect of making tests with the
Client impossible without hitting Discord's REST API for every test
(even worse, while unauthorized).
Knowing the user's ID on creation isn't _too_ important, and what was
being done with that knowledge can be deferred to connection start.
|
| |
|
|
|
|
| |
Instead of creating different `new` functions for every bridged feature
combination, accept a struct of options. Structs can have conditional
fields, unlike functions which can not have conditional arguments.
|
| | |
|
| |
|
|
|
| |
Add the user ID to the client. This can be used when initializing the
framework on connection start, as well as the future voice manager.
|
| |
|
|
|
|
|
|
| |
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)
|
| |
|
|
|
| |
The framework no longer needs the `is_bot` boolean state, since serenity
now only supports bot users.
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
| |
Add a function to determine which of two members has the higher
role hierarchy.
|
| | |
|
| |
|
|
|
|
|
| |
When calculating the latency between when a heartbeat was sent and a
heartbeat acknowledgement was received, ensure that the heartbeat
acknowledgement was received after the heartbeat was sent. This avoids a
panic. Otherwise, return None.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| | |
|