Everything you need to know about using Lavalink
Lavalink is a standalone audio sending node based on Lavaplayer and Koe. It allows for sending audio without it ever reaching any of your Discord bot shards.
With Lavalink, you can:
To run Lavalink, you'll need:
Lavalink uses an application.yml file for configuration. Here's a basic example:
server:
port: 2333
address: 0.0.0.0
lavalink:
server:
password: "youshallnotpass"
sources:
youtube: true
bandcamp: true
soundcloud: true
twitch: true
vimeo: true
http: true
local: false
bufferDurationMs: 400
youtubePlaylistLoadLimit: 6
playerUpdateInterval: 5
youtubeSearchEnabled: true
soundcloudSearchEnabled: true
gc-warnings: true
metrics:
prometheus:
enabled: false
endpoint: /metrics
sentry:
dsn: ""
environment: ""
The most important settings to change are:
To connect your Discord bot to Lavalink, you'll need a client library. Here are some popular options:
Lavalink provides a REST API for managing players and tracks. All endpoints require authentication using the password specified in the configuration.
Common endpoints include:
GET /loadtracks - Load tracks from a URLGET /decodetrack - Decode a trackGET /decodetracks - Decode multiple tracksGET /version - Get version informationGET /stats - Get server statisticsFor detailed API documentation, visit theLavalink Protocol documentation.
If your bot can't connect to Lavalink, check:
If audio isn't playing:
If Lavalink is using too much CPU: