30 releases

0.11.0 Feb 26, 2024
0.10.0-beta.3 Sep 16, 2023
0.9.0-rc.3 Dec 25, 2021
0.9.0-rc.2 Sep 22, 2021
0.3.0-alpha Oct 24, 2020

#687 in Web programming

Download history 7/week @ 2024-02-04 16/week @ 2024-02-18 189/week @ 2024-02-25 17/week @ 2024-03-03 22/week @ 2024-03-10 1/week @ 2024-03-17 65/week @ 2024-03-31 19/week @ 2024-04-07 2/week @ 2024-04-14

86 downloads per month

MPL-2.0 license

610KB
3.5K SLoC

lavalink-rs

An API Wrapper for lavalink. Compatible with all tokio 1.x based discord crates or asyncio based discord python libraries.

If you have questions, you can get support in the serenity or lavalink discord servers, or by opening an issue in the gitlab repository.

To-Do

0.12

  • Implement some const methods
  • RoutePlanner API
  • Switch from reqwests to hyper
  • native and webpki roots for rustls feature separation
  • Support tokio-websockets
  • Expose Http and methods to python
  • Implement search utilities to python

Future

  • Streamable queue reader
  • Improve documentation with examples, better formatting, and fill in missing data
  • Expand event logging
  • hikari-lightbulb example
  • discord.py example
  • hata example
  • twilight-rs example
  • Gitlab CI Tests
  • Implement abstractions for ease of use
  • Region based node selection method

Done

  • native_tls backend
  • Player queues
  • Readbale player queues
  • Search engine helpers
  • Write basic cocumentation
  • Songbird utilities
  • Serenity utilities
  • Twilight utilities
  • Load balancer node selection method
  • Lavasnek (PyO3)
  • Lavasnek events
  • Remove third party dependency for custom user data.
  • Round-Robin node selection method
  • Main and fallback node selection method
  • CPU Load based node selection method
  • Memory usage based node selection method
  • Custom node selection method
  • Python stubs
  • Basic Twilight 0.16 support
  • Hide password from logs

To install Lavalink, you can follow their getting started guide.

How to use

Install the version from crates.io:

lavalink-rs = "0.11"

# or

[dependencies.lavalink-rs]
version = "0.11"

Or the development release:

lavalink-rs = { git = "https://gitlab.com/vicky5124/lavalink-rs/", branch = "main"}

# or

[dependencies.lavalink-rs]
git = "https://gitlab.com/vicky5124/lavalink-rs/"
branch = "main"

If you wish to use a development version of songbird (or serenity, or twilight-model), add the following to the Cargo.toml:

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

[dependencies.songbird]
git = "https://github.com/serenity-rs/songbird"
branch = "next"

To build for python, you can use maturin.

python3 -m venv .venv
source .venv/bin/activate
python3 -m pip install maturin
maturin develop --target x86_64-unknown-linux-gnu

Features

  • macros: default feature - Adds procedural macros for ease of use.
  • rustls: default feature - Use rustls.
  • native-tls Use the system native tls.
  • serenity for serenity support.
  • songbird for songbird support.
  • twilight for twilight-model v0.15 support.
  • twilight16 for twilight-model v0.16-rc support.
  • python for python3.8+ support.

Contributing

To contribute to the project, fork the gitlab repository and create a merge request over there. Make sure to update the changelog with whatever update you did to the library.

Dependencies

~8–46MB
~752K SLoC