#discord #serenity #twilight #tokio #lavalink

lavalink-rs

Lavalink bindings for async discord api crates

23 releases (8 breaking)

new 0.9.0-rc.2 Sep 22, 2021
0.8.0 Jul 19, 2021
0.7.0 Mar 2, 2021
0.3.0-alpha Oct 24, 2020

#16 in Multimedia

Download history 28/week @ 2021-06-07 5/week @ 2021-06-14 2/week @ 2021-06-21 4/week @ 2021-06-28 4/week @ 2021-07-05 10/week @ 2021-07-12 53/week @ 2021-07-19 43/week @ 2021-07-26 152/week @ 2021-08-02 26/week @ 2021-08-09 103/week @ 2021-08-16 34/week @ 2021-08-23 47/week @ 2021-08-30 27/week @ 2021-09-06 55/week @ 2021-09-13 93/week @ 2021-09-20

193 downloads per month

MPL-2.0 license

80KB
2K SLoC

Lavalink-rs

A lavalink API wrapping library for every tokio discord crate.

Links to download stuff you will need

TODO

  • Support multiple connections per region.
  • Support nodes.
  • Support actual nodes.
  • Switch to internal lock handles.
  • Support identifiers.
  • Support pause, resume, skip to time.
  • Support starting at specific times and configurable replace current stream.
  • Support equalization.
  • Support both rustls and native_tls backends as features.
  • Support twilight.
  • Support events.
  • Support raw events.
  • Implement my own event handler for voice connections.
  • Support Sharding for the discord gateway.
  • Support easy queues natively.
  • Optimize the codebase.
  • Remove all the clones from examples.
  • Improve error handling.
  • Add tracing and logging.
  • Add documentation.
  • Implement automatic reconnecting.
  • Make a ClientBuilder

How to use

The minimum required Rust version is 1.51 due to a dependency of Songbird.

Install the version from crates.io:

lavalink-rs = "0.9-rc"
# or
[dependencies.lavalink-rs]
version = "0.9-rc"

Or the development release:

lavalink-rs = { git = "https://gitlab.com/vicky5124/lavalink-rs/", branch = "master"}
# or
[dependencies.lavalink-rs]
git = "https://gitlab.com/vicky5124/lavalink-rs/"
branch = "master"

If you wish to use a development version of serenity, add the following to the Cargo.toml:

[patch.crates-io.serenity]
git = "https://github.com/serenity-rs/serenity"
branch = "next"

Features

Default features are: rustls and songbird These are the available ones:

  • rustls: Use the rustls TLS backend.
  • native: Uses the system native TLS backend (OpenSSL on linux).
  • songbird: Use songbird to connect to handle voice connections.
  • simple-gateway: Use lavalink-rs to handle the voice connections (note, this is a very basic implementation, without sharding support, while also creating a second gateway rather than using the existing one).
  • serenity: Add support for serenity's models.
  • twilight: Add support for twilight-model.

Dependencies

~5–11MB
~250K SLoC