Commit Graph

226 Commits

Author SHA1 Message Date
Kyle Simpson
f1ed41ea28 Examples: Fix serenity-next cache accesses (#99)
Serenity's cache design has changed, this (finally) prevents the examples from failing to compile on CI.
2022-07-22 15:41:18 +01:00
tkt
67ad7c9e49 Deps: Bump streamcatcher version -> 1.0 (#93) 2022-07-22 15:41:18 +01:00
Sam W
f9b7e76bb1 Chore: Update link to lavalink-basic-bot.rs (#135)
Update the link to lavalink-basic-bot.rs in the twilight example.
2022-07-17 22:31:44 +01:00
Kyle Simpson
8791805804 Driver: Prevent panic when decrypting undersized RTP packets (#122)
Decrypt logic had two locations where the nonce would be separated from the payload without verifying the buffer size first, causing a panic for small packets.

Nonce and header removal now return an error if there are insufficient bytes.

Tested using `cargo make ready`, with some new tests to check that small packets simply return an `Err(...)`, and that encryption/decryption still function.
2022-04-19 11:16:47 +01:00
Kyle Simpson
312457eb74 Chore: Pin flume version to prevent MSRV breakage.
Flume's latest patch version requires toe new Rust 2021 edition, which is at odds with the current MSRV. This was tested using `cargo msrv` on the default feature set.
2022-04-02 17:31:35 +01:00
Kyle Simpson
05c6762228 Chore: Bump MSRV to 1.51.0
This bump must occur due to a patch update for Rustls which has (unfortunately) broken MSRV.
2022-03-21 13:39:47 +00:00
Kyle Simpson
806a422a2e Events: Document format of VoiceData. (#114)
Closes #100.
2022-02-14 15:00:57 +00:00
Kyle Simpson
16acfd4ee1 Chore: Release v0.2.2 2022-02-13 19:25:52 +00:00
Kyle Simpson
652ec1f293 Docs: fix ClientConnect to recommend SpeakingStateUpdate 2022-02-13 18:53:33 +00:00
Kyle Simpson
c464fcc38d Events: Deprecate ClientConnect (#112)
Discord no longer send these websocket payloads, users should instead rely on the main part of their bot for determining actual connection events, or `SpeakingUpdate`s for SSRC mapping.

Closes #104.
2022-02-13 12:06:50 +00:00
Ryo Takahashi
2feadc761e Chore: Fix typo in CHANGELOG.md (#111) 2022-01-26 21:48:07 +00:00
Miles Frankel
ecc47d588a Input: add ChildContainer::new (#108) 2022-01-12 10:58:59 +00:00
Kyle Simpson
00295bd3be Chore: Release v0.2.1 2022-01-05 10:40:10 +00:00
Lunarmagpie
73323e58dd Docs: added documentation for yt-dlp feature (#106)
* Docs: added documentation for yt-dlp feature
* Docs: remove trailing whitespace
2022-01-04 13:45:39 +00:00
Luukas Pörtfors
62ecfe68d6 Examples: Fix unmatched quotation mark in comment. (#101) 2021-10-18 10:59:57 +01:00
Miezhiko
6fcb196e34 Input: Allows yt-dlp usage as another youtube-dl fork (#90)
Signed-off-by: Miezhiko <Miezhiko@gmail.com>
2021-10-10 20:56:32 +01:00
Kyle Simpson
e25cc140b8 Events: fix handling of multiple timed events on a single track (#96)
Fixes an issue where the `EventData` were not stored in reverse order, meaning that only the last added TimedEvent would be serviced.

This reverses the `Ord` for `EventData`, which should only be internally compared, allowing all timed events to be processed correctly in order.

Fixes #95.
2021-09-29 09:51:39 +01:00
Kyle Simpson
562723f4b1 Chore: Release v0.2.0 2021-08-17 14:09:13 +01:00
Kyle Simpson
47e20d6177 Deps: Bump async-tungstenite version -> 0.14 2021-08-17 14:01:32 +01:00
Kyle Simpson
dad48ca835 Driver: Fix incorrect leave behaviour in Drop handler
Sending poison messages should suffice to kill the voice session: attempting to `.leave()`. Fixes #88.

This was tested using `cargo make ready` and the modified `serenity/voice/` example.
2021-08-17 12:14:50 +01:00
Kyle Simpson
3efe756ca5 Chore: Update Lavalink URLs
Author's GitHub page had changed. Closes #86.
2021-08-17 11:41:52 +01:00
Vilgot Fredenberg
1b0bcbb5f6 Deps: Bump twilight versions -> [0.5, 0.7) (#87)
Includes two more small changes too small to warrant PRs.
1. Removes the `shard_count` parameter from `Songbird::twilight` & `Songbird::twilight_from_config` since the cluster contains it.
2. Drops the `Arc` wrapper around `Songbird` to match against an upcoming twilight 0.7 change
2021-08-16 20:31:27 +01:00
Kyle Simpson
54e75bdc28 Release v0.2.0-beta.4 2021-07-01 12:17:22 +01:00
Kyle Simpson
338a042343 Fix: Update Benchmark Imports 2021-07-01 11:55:40 +01:00
Vilgot Fredenberg
91d7542593 Tracks: Remove box around TrackState (#84)
Boxing is unnecessary since `TrackState` implements copy.

Tested using `cargo make ready`.
2021-07-01 11:55:35 +01:00
Kyle Simpson
210e3ae584 Driver: Automate (re)connection logic (#81)
This PR adds several enhancements to Driver connection logic:
* Driver (re)connection attempts now have a default timeout of around 10s.
* The driver will now attempt to retry full connection attempts using a user-provided strategy: currently, this defaults to 5 attempts under an exponential backoff strategy.
* The driver will now fire `DriverDisconnect` events at the end of any session -- this unifies (re)connection failure events with session expiry as seen in #76, which should provide users with enough detail to know *which* voice channel to reconnect to. Users still need to be careful to read the session/channel IDs to ensure that they aren't overwriting another join.

This has been tested using `cargo make ready`, and by setting low timeouts to force failures in the voice receive example (with some additional error handlers).

Closes #68.
2021-07-01 11:55:31 +01:00
Kyle Simpson
8381f8c461 Chore: Release v0.2.0-beta.3 2021-07-01 11:34:53 +01:00
Kyle Simpson
be3030932e Chore: Clippy fixes for new lints 2021-07-01 11:34:30 +01:00
Vilgot Fredenberg
d6d6acabe1 Deps: Bump twilight versions -> 0.5 (#79) 2021-07-01 11:34:30 +01:00
Vilgot Fredenberg
00c8bc915a Input: Add separate YouTube title and channel to Metadata (#75) 2021-07-01 11:34:30 +01:00
Kyle Simpson
e47861c009 Chore: Release v0.2.0-beta.2 2021-07-01 11:34:30 +01:00
Vilgot Fredenberg
55e1567b90 Input, Driver: Make error messages more idiomatic (#74) 2021-07-01 11:33:51 +01:00
Kyle Simpson
3e0793644f Chore: Rewrite update pathway.
I had written this out before, but evidently it was lost somehow. This should fill in most of what was lost.
2021-07-01 11:33:51 +01:00
Kyle Simpson
cdebf79f07 Deps: Bump DiscoRTP version -> 0.4
Simple enough, tested using `cargo make ready`.
2021-07-01 11:33:51 +01:00
Vilgot Fredenberg
7045e2ec5a Input: Implement StdError for DcaError, input::Error (#73) 2021-07-01 11:33:51 +01:00
Kyle Simpson
6a441ba2f9 Chore: Release v0.2.0-beta1 2021-07-01 11:33:51 +01:00
Kyle Simpson
0f54d18455 Gateway: Add debug logging around shard handling
Adds some additional logging around some critical sections, rarely hit (i.e., during shard reconnections) in pursuit of issue #69. It's strongly suspected to lie here, at any rate...
2021-07-01 11:33:12 +01:00
Kyle Simpson
6d66b499e5 Deps: Bump twilight versions -> 0.4 2021-07-01 11:33:12 +01:00
Kyle Simpson
d1999776a8 Release v0.2.0-beta0 2021-07-01 11:33:12 +01:00
Kyle Simpson
fea204366b Chore: Repair formatting. 2021-07-01 11:30:02 +01:00
Kyle Simpson
91be0df5d5 Chore: Fix clippy warnings (useless clones). 2021-07-01 11:30:02 +01:00
Kyle Simpson
94c57f4ab5 Deps: Bump xsalsa20poly1305 version -> 0.7
This dependency upgrade (at last) resolves the duplicated rand_core versions present in builds. This was tested using `cargo make ready`.
2021-07-01 11:30:02 +01:00
Clarity
3c9b421fb4 Input: Change all Youtube-dl functions to take AsRef<str> (#70)
Unifies the API on all ytdl functions to remove some friction in passing in Strings, Cows, strs, and so on.

Closes #57.
2021-07-01 11:30:02 +01:00
James Liu
bc9a78e050 Use symphonia::io::MediaSource for Reader extensions (#61)
This PR does the following:

 * Changes both `Reader::Extension` and `Reader::ExtensionSeek`  to use `symphonia::io::MediaSource`.
 * Removes the `File` and `Vec` variants of readers, instead opting to provide a `from_file` and `from_memory` associated function to create readers from the `File` and `Cursor<Vec<u8>>` implementations of `MediaSource`. 
 * Removes the ReadSeek trait.
 * Added a dependency on `symphonia_core`. This crate has no additional dependencies.
2021-07-01 11:30:02 +01:00
Kyle Simpson
0bb2572deb Chore: Adapt #60, #64 in line with other breaking changes.
This commit undoes #64 (and bumps the library MSRV accordingly), and modifies #60 to match the new `Call` connection handling.

This was tested using `cargo make ready`, and rustc v1.49.0 on `examples/serenity/voice`.
2021-07-01 11:30:01 +01:00
Kyle Simpson
af2347c128 Input: Rename YTDL error variants for Clippy (#55)
This silences a clippy lint around incorrect capitalisation of acronyms, but sis a breaking API change.

This was tested using `cargo make ready`.
2021-07-01 11:30:01 +01:00
Kyle Simpson
27f26ade99 Events: Break out and non-exhaust context body structs (#54)
This PR makes many of the types under `EventContext` separate `#[non_exhaustive]` structs. This makes it more feasible to add further information to connection and packet events as required in future. On this note, driver (re)connection events now include the SSRC supplied by Discord and the domain name which was connected to.

In addition, this fixes global timed events to return a list of all live tracks, and extensively details/documents events at a high level.

This was tested using `cargo make ready`.
2021-07-01 11:30:01 +01:00
Kyle Simpson
1bfee1b989 Driver: Move Bitrate import out of crate root. (#53)
This is a simple organisational change which moves `crate::Bitrate` to `crate::driver::Bitrate` to slightly clean up the crate root.

This has been tested using `cargo make ready`.
2021-07-01 11:30:01 +01:00
Kyle Simpson
1fc3dc2259 Gateway: Add connection timeout, add Config to gateway. (#51)
This change fixes tasks hanging due to rare cases of messages being lost between full Discord reconnections by placing a configurable timeout on the `ConnectionInfo` responses. This is a companion fix to [serenity#1255](https://github.com/serenity-rs/serenity/pull/1255). To make this doable, `Config`s are now used by all versions of `Songbird`/`Call`, and relevant functions are  added to simplify setup with configuration. These are now non-exhaustive, correcting an earlier oversight. For future extensibility, this PR moves the return type of `join`/`join_gateway` into a custom future (no longer leaking flume's `RecvFut` type).

Additionally, this fixes the Makefile's feature sets for driver/gateway-only compilation.

This is a breaking change in:
* the return types of `join`/`join_gateway`
* moving `crate::driver::Config` -> `crate::Config`,
* `Config` and `JoinError` becoming `#[non_breaking]`.

This was tested via `cargo make ready`, and by testing `examples/serenity/voice_receive` with various timeout settings.
2021-07-01 11:30:01 +01:00
Kyle Simpson
f449d4f679 Deps: Bump DiscoRTP version -> 0.3 (#52)
This change increases the version of DiscoRTP, which fixes upstream issues in libpnet and allows additional RTCP types to be added over time without breaking semver. This is a breaking change for users explicitly matching on RTCP packet types, as DiscoRTP is exposed here.

This has been tested using `cargo make ready`.
2021-07-01 11:30:01 +01:00