Skip to content

Getting Started

Installation

Terminal window
npm install aoijs.lavalink

Configuration

The setup is used to initialize the bot client and configure the Lavalink music system. aoi.js is the main client framework, and aoijs.lavalink is an integration that allows you to connect to a Lavalink server to stream music.

1
const { AoiClient } = require('aoi.js');
2
const { Manager } = require('aoijs.lavalink'); // Importing the MusicClient for handling Lavalink integration.
3
4
const client = new AoiClient({ ... });
5
6
const voice = new Manager(client, {
7
nodes: [{
8
name: 'my lavalink node', // A custom name for the Lavalink node (can be any string).
9
host: 'yourdomain.com', // URL to your Lavalink node. Replace with your actual Lavalink server URL.
10
port: 0000, // Your lavalink server port.
11
auth: 'youshallnotpass', // Authentication password for the Lavalink node.
12
secure: false // Set to true if your Lavalink server uses SSL/TLS (HTTPS).
13
}],
14
maxQueueSize: 100, // Maximum number of tracks that can be queued for playback. (default is 100)
15
maxPlaylistSize: 100, // Maximum number of tracks that can be in a playlist. (default is 100)
16
searchEngine: 'ytsearch', // Default search engine. You can set this to 'ytsearch' or 'scsearch' or others. (default is ytsearch)
17
debug: false // Whether to enable debug logs for the music client. default is false. (default is false)
18
});

see here for more client options.