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

yet-another-discord.js-musicbot-addon

v2.2.5

Published

yet another discord.js musicbot addon, but based on [email protected] (master)

Downloads

7

Readme

Yet Another Discord MusicBot Addon

An easily customizable Node.js based music extension/bot for [email protected] (master) projects using YouTube. Doesn't have inbuilt command handling, either use discord.js-commando or make your own. Supports multiple servers.

Functions.

Common to all functions is a discord.js/discord.js-commando message object. | Function | Description | Parameters | | ----------------------------------------------- | ------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | | async playFunction(msg, query, force = false) | Plays the song specified in the query | query: is the search query, can be URLs, force: boolean(to force playback instead of adding to the queue) | | pauseFunction(msg) | Pauses current song playback | | | resumeFunction(msg) | Resumes current song playback | | | stopFunction(msg) | Stops current song playback and clears the queue | | | clearFunction(msg) | Clears the queue | | | async joinFunction(msg) | Joins the channel | | | leaveFunction(msg) | Leaves the channel | | | repeatFunction(msg, mode) | Changes the repeat modes for the playback | mode: one|all|off | | shuffleFunction(msg) | Shuffles the current queue | | | skipFunction(msg) | Skips current song | | | previousFunction(msg) | Plays most recently played song from history | | | removeFunction(msg, songIndex) | Removes a song at particular index from the queue | songIndex: number | | volumeFunction(msg, volume) | Sets volume of playback | volume: number: 0<=x<=200 | | nowPlayingFunction(msg) | Shows currently playing song, with it's info, also has cool reaction buttons to control playback. | | | showHistoryFunction(msg) | Shows history of playback | | | showQueueFunction(msg) | Shows queue | | | searchFiltersModeFunction(msg, mode) | Enable or disable search filters | mode: on|off | | setSearchFiltersFunction(msg, filters) | Set search filters | filters: array | | showSearchFiltersFunction(msg) | Show current search filters and status of search filters | |

Installation

Pre-installation:

  1. npm install github:discordjs/discord.js

  2. npm install node-opus or npm install opusscript Required for voice. Discord.js prefers node-opus.

Installation:

  • npm install yet-another-discord.js-musicbot-addon Long name I know 😁

Examples

Basic Bot Example

// Require the Discord.js client or Discord.js-commando client.
const Discord = require('discord.js');
const client = new Discord.Client();
// Import the MusicClient Class from the module
const MusicClient = require("yet-another-discord.js-musicbot-addon");
// Put the Music module in the new Client object.
// This allows for easy access to all the modules
// functions and data.
client.music = new MusicClient(client, {
  // Set the api key used for YouTube.
  // This is required to run the bot.
	apiKey: "YouTubeAPIKeyHere",
	//all other options are optional
	defVolume: 50,
	bitRate: 12000,
	maxHistory: 50,
	maxQueue: 100,
	searchFilters: ['cover', 'live', 'remix', 'mix', 'parody', 'hour', 'extended', 'trailer'],
	color: 13632027,
	logger: logger()
});
// Connect the bot with your Discord applications bot token.
client.login("token");

Commands example
See the examples directory.
Currently I have only discord.js-commando examples there, but you can use any kind-of command parser.

Options & Config.

apiKey option is only required, other options are optional and thus not needed.
The options you can pass in new MusicClient(client,{options}) and their types is as followed:

Basic Options.

| Option | Type | Description | Default | | ------------- | ----------------- | ---------------------------------------------------------------------------------------------------------------- | --------------------- | | apiKey | String | A YouTube Data API3 key. Required to run. | NaN | | defVolume | Number | The default volume of music. 1 - 100. | 50 | | bitRate | String | Sets the preferred bitRate for the Discord.js stream to use. | "120000" | | maxHistory | Number | Max history size allowed. | 50 | | maxQueue | Number | Max queue size allowed. | 500 | | searchFilters | Object/Array | List of filters for the YouTube query search, ignores results matching the filters unless specified in query. | [ ] | | maxHistory | Number | Max history size allowed. | 50 | | color | Number | Color of the embeds. | 13632027 | | autoLeaveIn | Number | Specifies the amount of time after which the bot leaves channel after playback (in ms), 0 to disable auto leave. | 5 * 60 * 1000 (5 min) | | logger | Class or Function | For custom logger. | console |