discord.js-music-bot-bluspring v0.4.1
Music Test Bot
A standalone Discord.JS music bot based on DarkoPendragon's discord.js-musicbot-addon module. Some parts of this code is taken from his module (v1.5.1 and v1.10.3) Developers: Naz // BluSpring, Damo // CodaEnder You are allowed to take any piece of code from here into your own music bot :) You are also allowed to fork this code and edit the code into a module. Another thing is you are allowed to not credit me (finally doing this for once) This is open-source code, anyway. I left some notes for help. Please join my bot's Discord server here for assistance with the module: FoozBallKing Bot Official
How to use
First off, cd
into the bot folder (after downloading it) and type npm i
. This will install all the required modules.
Rename the d_config.json
file to config.json
.
Also, please install FFMPEG. Instructions here.
And also, install either node-opus or opusscript.
npm i -s node-opus
OR npm i -s opusscript
How to use eval? Edit the code file, look for "admins" and replace the array of user IDs with yours and your trustable friends!
Configurations
Option | Type | Required? | Description | Default |
---|---|---|---|---|
ytapi3 | String | yes | Required to search for YT videos. How to get one is here | None |
prefix | String | no | Shows what you want your bot to respond to. | ! |
helpCmd | String | no | What should the help command be. | help |
playCmd | String | no | What should the play command be. | play |
pauseCmd | String | no | What should the pause command be. (UNFINISHED) | pause |
stopCmd | String | no | What should the stop command be. (UNFINISHED) | stop |
queueCmd | String | no | What should the queue command be. | queue |
npCmd | String | no | What should the Now Playing command be. | np |
skipCmd | String | no | What should the skip command be. | skip |
resumeCmd | String | no | What should the resume command be. | resume |
downloadVid | Boolean | no | If you want to download the video. Make sure the audio_temp folder is there. | false |
loopCmd | String | no | What should the loop command be. | loop |
randomGame | Boolean | no | If you want the bot to be able to do a random game every time it boots up. | false |
Also, make sure the commands are done in lowercase, since the code already makes the commands go from uppercase to lowercase. Basic configuration:
const music = require('discord.js-music-bot-bluspring')
const Discord = require('discord.js')
const bot = new Discord.Client()
const Music = new music(bot, {
ytapi3": "youtube-api-key"
})
Advanced configuration:
const music = require('discord.js-music-bot-bluspring')
const Discord = require('discord.js')
const bot = new Discord.Client()
const Music = new music(bot, {
ytapi3: "youtube-api-key",
prefix: "!",
helpCmd: "gitsomehelp",
playCmd: "add",
pauseCmd: "stopfornow",
stopCmd: "stahp",
queueCmd: "gimmedaqueue",
npCmd: "whatsplaying",
downloadVid: true,
resumeCmd: "continue",
skipCmd: "switch",
loopCmd": "repeat",
randomGame: true
})
Common installation issues:
Issue: (Trivial) FFMPEG was not found on your system.
Fix: Make sure ffmpeg is installed correctly and set in your PATH variable.
Issue: (Uncommon) Couldn't find an Opus engine.
Fix: npm install node-opus
or npm install opusscript
Issue: (Rare) NPM ERR Cannot read property '0' of undefined
Fix: npm i -g npm@4.6.1
or another lower version of npm.
Issue: (Rare) TypeError: Invalid non-string/buffer chunk
Fix: Stop using ffmpeg-binaries
. Seriously. It's been said enough to use ffmpeg
itself by now.
Issue: (Trivial) Any node-gyp errors. (build fail, missing cl.exe, etc.)
Fix: This one is a little more complicated.
1. Type npm i -g --production windows-build-tools
OR
- Download and install Visual Studio 2015
- New project -> Visual C++
- Install Visual C++
If that doesn't fix your issue;
1. Download and install the Windows 8.1 SDK
Issue: (Uncommon) ffluent-ffmpeg
errors.
1. Download and install ffmpeg correctly for your OS/env.