Discord MusicBot Plugin
About
An easy to use music addon for discord bots. Uses Discord.js and YouTube.
Installing via NPM
npm install discord.js-musicbot-plugin
Adding to your bot
const music = ; // Pass in your Discord.js client and the voice channel ID// This adds the music functions to the client objectmusic;
Commands
Commands can be called using the following syntax, make sure to pass in the message that requested the command as an argument.
// client = Your Discord.js client// command = The command you are trying to useclientmusic;
The following commands are available:
Command | Description |
---|---|
clear() | Clears the queue |
play() | Adds a song or playlist to the queue |
replay() | Restarts current song |
skip() | Skips current song |
volume() | Set/Display current volume |
Example usage
Here is an example of a simple bot using the play() command:
// require Discord.js and create a new clientconst Discord = ;const client = ; // require musicbot pluginconst music = ; // add musicbot functions to client objectmusic; // connect your bot to discordclient; // command handlerclient;