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

akira-js-music

v1.3.7

Published

Music plugin for discord.js v12 bots

Downloads

7

Readme

Discord.js Music Plugin

alt text

This version is not yet stable, although has been mildly tested, it has not been that extensive.
It's an update of the original by ruiqimao for Discord.js's version v11.x, and adds a few extra sprinkles. It still requires tweaks and testing but yeah it's something.

The commands available are:

  • play (<url>|<search string>): Play a video/music. It can take a URL from various services (YouTube, Vimeo, YouKu, etc). You can also search using a string.
  • skip [number]: Skip some number of songs. Will skip 1 song if a number is not specified.
  • queue: Display the current queue.
  • pause: Pause music playback. (requires music manager)
  • resume: Resume music playback. (requires music manager)
  • volume: Adjust the playback volume between 1 and 200 (requires music manager)
  • leave: Clears the song queue and leaves the channel.
  • clearqueue: Clears the song queue.

Permissions:

  • If anyoneCanSkip is false then only admins and the user that requested the song can skip it.
  • Only admins can change volume or resume/pause music.

Things added:

  • Search is working again.
  • Added the command 'volume'
  • Added the command 'leave'
  • Added the command 'clearqueue'

Things changed:

  • Permissions

Pre-installation:

  1. npm install discord.js // The core discord.js framework.
  2. npm install ffmpeg-binaries // Gives your ability the bot to hear (required to join vc)
  3. npm install node-opus or npm install opusscript // Required to stream audio, node-opus recommended

Installation:

  1. npm install discord.js-music-v11

Common installation issues:
Issue: FFMPEG was not found on your system, so audio cannot be played. Please make sure FFMPEG is installed and in your PATH.
Fix: npm install ffmpeg-binaries
Issue: Couldn't find an Opus engine.
Fix: npm install node-opus or npm install opusscript
Issue: Any node-gyp errors. (build fail, missing cl.exe, etc.)
Fix: This one is a little more complicated.

  1. Download and install Visual Studio 2015
  2. New project -> Visual C++
  3. Install Visual C++

If that doesn't fix your issue;

  1. Download and install the Windows 8.1 SDK

This is a music plugin for Discord.js. Using it is as easy as:

const Discord = require('discord.js');
const music = require('discord.js-music-v11');
const Bot = new Discord.Client();
const token = "<auth_token>" // Recommended to load from json file.

Bot.on('ready', () => {
    console.log(`[Start] ${new Date()}`);
});

music(Bot);
Bot.login(token);

The module consists of a single function, which takes two arguments:

/*
 * @param {Client} client - The discord.js client.
 * @param {object} options - (Optional) Options to configure the music bot. Acceptable options are:
 * 		prefix: The prefix to use for the commands (default '!').
 * 		global: Whether to use a global queue instead of a server-specific queue (default false).
 * 		maxQueueSize: The maximum queue size (default 20).
 * 		anyoneCanSkip: Allow anybody to skip the song.
 * 		clearInvoker: Clear the command message.
 * 		volume: The default volume of the player.
 */
music(client, options);