discord.js-lavalink
A lavalink client for Discord.js
Documentation
mrjacz.github.io/discord.js-lavalink
Installation
For stable
# Using yarn yarn add discord.js-lavalink # Using npm npm install discord.js-lavalink
For Development
# Using yarn yarn add MrJacz/discord.js-lavalink # Using npm npm install MrJacz/discord.js-lavalink
LavaLink configuration
Download from the CI server
Put an application.yml
file in your working directory. Example
Run with java -jar Lavalink.jar
The issue tracker is for issues only
If you're having a problem with the module contact us in the Discord Server
Implementation
Start by creating a new PlayerManager
passing an array of nodes and an object with user
the client's user id and shards
The total number of shards your bot is operating on.
const PlayerManager = ; const nodes = host: "localhost" port: 2333 password: "youshallnotpass" ; const manager = client nodes user: clientuserid // Client id shards: shardCount // Total number of shards your bot is operating on; manager;
Resolving tracks using LavaLink REST API
const fetch = ;const URLSearchParams = ; { const node = clientplayernodes; const params = ; params; return ;} ;
Joining and Leaving channels
// Joinconst player = await manager; await player; // Track is a base64 string we get from Lavalink REST API player;player; // Leave voice channel and destory Playerawait manager; // Player ID aka guild id
For a proper example look at example/app.js