twilight-lavalink
twilight-lavalink is a client for Lavalink as part of the twilight
ecosystem.
It includes support for managing multiple nodes, a player manager for
conveniently using players to send events and retrieve information for each
guild, and an HTTP module for creating requests using the http crate and
providing models to deserialize their responses. It will automatically
handle sending voice channel updates to Lavalink by processing events via
the [client's process method][Lavalink::process], which you must call
with every Voice State Update and Voice Server Update you receive.
Features
http-support
The http-support feature adds support for the http module to return
request types from the http crate. This is enabled by default.
TLS
twilight-lavalink has features to enable async-tungstenite's TLS
features. These features are mutually exclusive. rustls is enabled by
default.
native
The native feature enables async-tungstenite's tokio-native-tls
feature.
To enable native, do something like this in your Cargo.toml:
[]
= { = false, = ["native"], = "0.2" }
rustls
The rustls feature enables async-tungstenite's tokio-rustls feature, which
use rustls as the TLS backend.
This is enabled by default.
Examples
Create a client, add a node, and give events to the client to process events:
use StreamExt;
use ;
use ;
use Client as HttpClient;
use ;
async
There is also an example of a basic bot located in the root of the
twilight repository.