New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

bdfd-lavalink

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bdfd-lavalink

Play music in BDFD using lavalink.

  • 1.8.1
  • unpublished
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

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') // We instantiate a discord client to interact with voice channels.

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://host_address:3000/join_voice_channel;{"id":"channel id"}]

GET /voice_channel_id/{guild_id}/{user_id} Get the voice channel ID of a guild member, or empty if none.

$httpGet[http://host_address:3000/$guildID/$authorID]
$httpResult[voice_id]

GET /search Performs a search on YouTube.

$httpGet[http://host_address:3000/search?q=never+gonna+give+you+up]
$httpResult[loadType]
$httpResult[tracksLength]

GET /track_info/{guild_id} Gets current played track or a different track with given position.

$httpGet[http://host_address:3000/track_info/$guildID]
$httpResult[loadType]
$httpResult[title]

Next track:
$httpGet[http://host_address:3000/track_info/$guildID?offset=2]
$httpResult[loadType]
$httpResult[title]

POST /play/{guild_id} Plays a song or adds it to the queue.

$httpGet[http://host_address:3000/search?q=never+gonna+give+you+up]
$var[track;$httpResult[tracks;0;track]]
$httpPost[http://host_address:3000/play/$guildID;{"track":"$var[track]"}]

$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://host_address:3000/resume/$guildID]
$httpResult[type]

POST /pause/{guild_id} Pauses current playing track in a guild.

$httpPost[http://host_address:3000/resume/$guildID]
$httpResult[type]

POST /volume/{guild_id} Sets volume of tracks in a guild.

$httpPost[http://host_address:3000/volume/$guildID;{"volume":125}]
$httpResult[type]

POST /seek/{guild_id} Seeks a playing track in a guild.

$c[Position is in milliseconds]
$httpPost[http://host_address:3000/seek/$guildID;{"seek":60000}]
$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://host_address:3000/search_and_play/$guildID?q=my+cool+song;{}]
$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://host_address:3000/skip/$guildID;{}]
$httpResult[type]

FAQs

Package last updated on 11 Feb 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc