npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

bdfd-lavalink-revamp

v1.0.1

Published

Play music in BDFD using lavalink.

Downloads

16

Readme

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') // 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]