0.4.1 • Published 6 years ago

discord.js-music-bot-bluspring v0.4.1

Weekly downloads
17
License
ISC
Repository
-
Last release
6 years ago

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

OptionTypeRequired?DescriptionDefault
ytapi3StringyesRequired to search for YT videos. How to get one is hereNone
prefixStringnoShows what you want your bot to respond to.!
helpCmdStringnoWhat should the help command be.help
playCmdStringnoWhat should the play command be.play
pauseCmdStringnoWhat should the pause command be. (UNFINISHED)pause
stopCmdStringnoWhat should the stop command be. (UNFINISHED)stop
queueCmdStringnoWhat should the queue command be.queue
npCmdStringnoWhat should the Now Playing command be.np
skipCmdStringnoWhat should the skip command be.skip
resumeCmdStringnoWhat should the resume command be.resume
downloadVidBooleannoIf you want to download the video. Make sure the audio_temp folder is there.false
loopCmdStringnoWhat should the loop command be.loop
randomGameBooleannoIf 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

  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

Issue: (Uncommon) ffluent-ffmpeg errors. 1. Download and install ffmpeg correctly for your OS/env.