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

better-discord-music

v1.1.0

Published

Just another discord music bot framework

Downloads

3

Readme

better-discord-music

!! Playlists, Spotify & Soundcloud are currently not supported but I'm working on it !!

Functions

  • .play() - Plays the given music in the given channel.

  • .stop() - Stops the music whenever it is playing.

  • .skip() - Skips the current playing song.

  • .pause() - Pauses the current playing song.

  • .resume() - Resumes the playing song whenever it is paused.

  • .repeat() - Repeats the playing song forever, until it is turned off.

  • .volume() - Changes the music volume.

  • .jump() - Jumps to a the given queue number song.

  • .getQueue() - Returns a Array of queued songs.

  • .removeQueue() - Removes the given queue song number from the queue.

  • .isConnected() - Checks whenever the bot is connected to a VC.

  • .isPaused() - Checks whenever the playing song is paused.

  • .isResumed() - Checks whenever the bot is playing a song.

  • .isRepeated() - Checks whenever the playing song is on repeat.

.play()

const musicbot = require('better-discord-music');

musicbot.play({
   interaction: interaction,
   channel: channel,
   song: song
});

.stop()

const musicbot = require('better-discord-music');

musicbot.stop({ interaction: interaction });

.skip()

const musicbot = require('better-discord-music');

musicbot.skip({ interaction: interaction });

.pause()

const musicbot = require('better-discord-music');

musicbot.pause({ interaction: interaction });

.resume()

const musicbot = require('better-discord-music');

musicbot.resume({ interaction: interaction });

.repeat()

const musicbot = require('better-discord-music');

musicbot.repeat({
   interaction: interaction,
   value: true/false
});

.volume()

const musicbot = require('better-discord-music');

musicbot.volume({
   interaction: interaction,
   volume: volume
});

.jump()

const musicbot = require('better-discord-music');

musicbot.jump({
   interaction: interaction,
   number: number
});

.getQueue()

const musicbot = require('better-discord-music');

console.log(await(musicbot.getQueue({ interaction: interaction })));

.removeQueue()

const musicbot = require('better-discord-music');

musicbot.removeQueue({
   interaction: interaction,
   number: number 
});

.isConnected()

const musicbot = require('better-discord-music');

console.log(await musicbot.isConnected({ interaction: interaction }))

.isPaused()

const musicbot = require('better-discord-music');

console.log(await musicbot.isPaused({ interaction: interaction }))

.isResumed()

const musicbot = require('better-discord-music');

console.log(await musicbot.isResumed({ interaction: interaction }))

.isPaused()

const musicbot = require('better-discord-music');

console.log(await musicbot.isRepeated({ interaction: interaction }))

Events

  • playSong - Runs whenever a new song started playing.
  • addSong - Runs whenever a song has been added to the queue.
  • playList - Runs whenever a new song of a playlist started playing.
  • addList - Runs whenever a playlist has been added to the queue.
  • finish - Runs whenever all the queued songs are played.
const musicbot = require('better-discord-music');
const eventHandler = musicbot.event;

eventHandler.on('playSong', async (channel, songInfo, requester) => {
    channel.send({
        content: `Started playing the song [${songInfo.title}](${songInfo.url}) by \`${songInfo.author}\`.
        This was requested by ${requester.tag} (${requester.id})`
    });
});

eventHandler.on('addSong', async (channel, songInfo, requester) => {
    channel.send({
        content: `Added the song [${songInfo.title}](${songInfo.url}) by \`${songInfo.author}\` to the queue.
        Added by ${requester.tag} (${requester.id})`
    });
});

eventHandler.on('playList', async (channel, playlist, songInfo, requester) => {
    channel.send({
        content: `Started playing the song [${songInfo.title}](${songInfo.url}) by \`${songInfo.author}\` of the playlist ${playlist.title}.
        This was requested by ${requester.tag} (${requester.id})`
    });
});

eventHandler.on('addList', async (channel, playlist, requester) => {
    channel.send({
        content: `Added the playlist [${playlist.title}](${playlist.url}) with ${playlist.videos.length} amount of videos to the queue.
        Added by ${requester.tag} (${requester.id})`
    });
});

eventHandler.on('finish', async (channel) => {
    channel.send({
        content: 'Party has been ended :('
    });
});