BDFD Lavalink
DISCLAIMER
We are no longer downloading files.
To connect to the lavalink server, put this code in a file on your host (f.e: index.js):
const { LavalinkServer } = require('bdfd-lavalink')
const server = new LavalinkServer({
apiPort: 3000,
url: "address_of_host",
lavalinkPort: "lavalink port"
})
<warn> MAKE SURE YOU ARE HOSTING A LAVALINK SERVER ON GIVEN HOST URL </warn>
server.init('bot token')
Run the file and wait for the server and client to be connected.
Available Endpoints
Note that all examples are with BDFD.
POST /join_voice_channel
Causes the bot to join desired voice channel using its ID.
$httpPost[http:
GET /voice_channel_id/{guild_id}/{user_id}
Get the voice channel ID of a guild member, or empty if none.
$httpGet[http:
$httpResult[voice_id]
GET /search
Performs a search on YouTube.
$httpGet[http:
$httpResult[loadType]
$httpResult[tracksLength]
GET /track_info/{guild_id}
Gets current played track or a different track with given position.
$httpGet[http:
$httpResult[loadType]
$httpResult[title]
Next track:
$httpGet[http:
$httpResult[loadType]
$httpResult[title]
POST /play/{guild_id}
Plays a song or adds it to the queue.
$httpGet[http:
$var[track;$httpResult[tracks;0;track]]
$httpPost[http:
$c[Anything that is not SUCCESS means an error.]
$httpResult[type]
$c[This will return true if it the provided track will be played now.]
$httpResult[playing_now]
POST /resume/{guild_id}
Resumes paused track in a guild.
$httpPost[http:
$httpResult[type]
POST /pause/{guild_id}
Pauses current playing track in a guild.
$httpPost[http:
$httpResult[type]
POST /volume/{guild_id}
Sets volume of tracks in a guild.
$httpPost[http:
$httpResult[type]
POST /seek/{guild_id}
Seeks a playing track in a guild.
$c[Position is in milliseconds]
$httpPost[http:
$httpResult[type]
POST /search_and_play/{guild_id}
Searches and plays (or queues) a track in a guild.
$c[I am not sure if these requests require a body therefore im leaving it empty.]
$httpPost[http:
$httpResult[type]
POST /skip/{guild_id}
Skips current song.
$c[I am not sure if these requests require a body therefore im leaving it empty.]
$httpPost[http:
$httpResult[type]