Skip to content
This repository has been archived by the owner on Jun 28, 2022. It is now read-only.

Commit

Permalink
1.6.1 update.
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkoPendragon committed Nov 7, 2017
1 parent a5c7f0a commit 6481000
Show file tree
Hide file tree
Showing 6 changed files with 489 additions and 304 deletions.
95 changes: 63 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# Discord.js Music Bot Addon
[![npm package](https://nodei.co/npm/discord.js-musicbot-addon.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/discord.js-musicbot-addon/)
[![Discord Server](https://discordapp.com/api/guilds/360519133219127297/embed.png)](https://discord.gg/cADwxKs) [![Downlaods](https://img.shields.io/npm/dt/discord.js-musicbot-addon.svg?maxAge=3600)](https://www.npmjs.com/package/discord.js-musicbot-addon) [![Version](https://img.shields.io/npm/v/discord.js-musicbot-addon.svg?maxAge=3600)](https://www.npmjs.com/package/discord.js-musicbot-addon)
***
Expand Down Expand Up @@ -31,19 +30,19 @@ __Pre-installation:__
It is recommended to have the stable over dev branch.

2. `ffmpeg installed` and in your PATH.
Allows the bot to join voice as well as speak.
Allows the bot to join voice as well as speak.
* Download the ffmpeg package for your system.
* Extract it to the proper place.
* Set it to your PATH environment variables.
* Set it to your PATH environment variables.

3. `npm install node-opus` or `npm install opusscript`
Required for voice. Discord _prefers_ node-opus, but it is your choice.

__Installation:__
* `npm install discord.js-musicbot-addon`

__Common installation issues:__
__Issue:__ FFMPEG was not found on your system.
__Issue:__ FFMPEG was not found on your system.
__Fix:__ Make sure ffmpeg is installed correctly and set in your PATH variable.

__Issue:__ Couldn't find an Opus engine.
Expand All @@ -61,6 +60,10 @@ __Fix:__ This one is a little more complicated.
If that doesn't fix your issue;
1. Download and install the [Windows 8.1 SDK](https://developer.microsoft.com/en-us/windows/downloads/windows-8-1-sdk)

__Issue:__ `ffluent-ffmpeg` errors.
1. Download and install ffmpeg correctly for your OS.
2. Make sure it's in your PATH/exported.

***
# Examples & Options
***
Expand All @@ -80,30 +83,43 @@ const music = new Music(<client>,
```

__Most options are optional and thus not needed.__
The options you can pass in music(client, options) is as followed:
* prefix: Prefix to set for commands.
* global: true/false. If set to true, will use global queues, false will use server. (default false)
* maxQueueSize: Max size of queues.
* anyoneCanSkip: Whether or not anyone can skip, true/false. Defaults false.
* anyoneCanAdjust: Whether or not anyone can set volume. Defaults false.
* clearInvoker: Whether or not to clear the command message.
* volume: Default volume. Anywhere from 1 to 200, default is 50.
* helpCmd: Name of the help command.
* playCmd: Sets the play command name.
* skipCmd: Sets the skip command name.
* queueCmd: Sets the queue command name.
* pauseCmd: Sets the name for the pause command.
* resumeCmd: Sets the name for the resume command.
* volumeCmd: Sets the name for the volume command.
* leaveCmd: Sets the name for the leave command.
* clearCmd: Sets the name for the clearqueue command.
* enableQueueStat: Disables or enables queue status (useful to prevent errors sometimes, defaults true).
* ownerOverMember: Makes it so you bypass restrictions from the bot.
* botOwner: ID of your account, __required__ if using ownerOverMember.
* logging: Disable/enable some extra, none need logging. Defaults to true. Useful but not needed.
* __youtubeKey:__ This is __REQUIRED__. Something [like this article](https://elfsight.com/help/how-to-get-youtube-api-key/) should help with that, or google how to get a YouTube API3 key.

An example of a few custom commands would be:
The options you can pass in `music(client, {options})` and their types is as followed:
* youtubeKey: *Required*, string, a YouTube API3 key.
* botPrefix: String, the prefix of the bot. Defaults to "!".
* global: Boolean, whether to use one global queue or server specific ones. Defaults false.
* maxQueueSize: Number, max queue size allowed. Defaults 20.
* defVolume: Number, the default volume of music. 1 - 200, defaults 50.
* anyoneCanSkip: Boolean, whether or not anyone can skip. Defaults false.
* clearInvoker: Boolean, whether to delete command messages. Defaults false.
* helpCmd: String, name of the help command.
* playCmd: String, name of the play command.
* skipCmd: String, name of the skip command.
* queueCmd: String, name of the queue command.
* pauseCmd: String, name of the pause command.
* resumeCmd: String, name of the resume command.
* volumeCmd: String, name of the volume command.
* leaveCmd: String, name of the leave command.
* clearCmd: String, name of the clear command.
* loopCmd: String, name of the loop command.
* enableQueueStat: Boolean, whether to enable the queue status, old fix for an error that probably won't occur.
* anyoneCanAdjust: Boolean, whether anyone can adjust volume. Defaults false.
* ownerOverMember: Boolean, whether the owner over-rides CanAdjust and CanSkip. Defaults false.
* botOwner: String, the ID of the Discord user to be seen as the owner. Required if using ownerOverMember.
* logging: Boolean, some extra none needed logging (such as caught errors that didn't crash the bot, etc). Defaults false.
* enableAliveMessage: Boolean, enables the bot to log a message in the console every x milliseconds.
* aliveMessage: String, the message to be logged.\*_note_
* aliveMessageTime: Number, time in _**milliseconds**_ the bot logs the message. Defaults to 600000 (5 minutes).

\* defaut for aliveMessage looks like:
```
----------------------------------
'BotUsername' online since 'lastReadyTime'!
----------------------------------
```

For the youtube API3 key, something [like this article](https://elfsight.com/help/how-to-get-youtube-api-key/) should help with that, or google how to get a YouTube API3 key from the Google console.

An example of a few custom options would be:
```javascript
const music = new Music(client, {
prefix: ">",
Expand All @@ -113,6 +129,7 @@ const music = new Music(client, {
playCmd: 'music',
leaveCmd: 'begone',
ownerOverMember: true,
enableClear: false,
botOwner: '1234567890',
youtubeKey: 'some-key_here'
});
Expand All @@ -123,18 +140,32 @@ Again if you have any issues, feel free to open one on the repo, or join my [Dis
***
# Changelog
***
# 1.6.1
* Fixed some typos and minor errors.

## 1.6
* Removed asynchronous functions since some people don't like using the latest and greatest.
* Added enabling/disabling commands.
* Added looping.
* "Class" update.
* Fixed some errors/bugs from 1.5.
* Added alive message function && (heh) options.
* Removed enabling/disabling commands until further notice.
* Added all additions from pull requests to the main npm module.
* Updated examples.

## 1.5.1
* Added playlist support (thanks Rodabaugh for reminding me).
* Fixed `clearqueue` crashing if queue is empty.
* Fixed `skip` crashing if the queue is empty.
* Now requires `ffmpeg` installed over `ffmpeg-binaries`.

## 1.4.0
* Added wrapping.
* Added owner over member options.
* Fixed errors.
* Reworked the the playing music method.
* Fixed (probably) UnknownSpawn errors.
* Reworked the playing music method.
* Fixed `UnknownSpawn` errors.
* Bot now requires your own YouTube Data API3 key for searching.
* Music is less likely to cut out now.
* Volume works again (again).
Expand Down
2 changes: 1 addition & 1 deletion examples/advancedMusicBot.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const music = new Music(client, {
prefix: prefix, // Prefix for the commands.
global: true, // Non-server-specific queues.
maxQueueSize: 25, // Maximum queue size of 25.
clearInvoker: true, // If permissions applicable, allow the bot to delete the messages that invoke it (start with prefix).
clearInvoker: true, // If permissions applicable, allow the bot to delete the messages that invoke it.
helpCmd: 'mhelp', //Sets the name for the help command.
playCmd: 'music', //Sets the name for the 'play' command.
volumeCmd: 'adjust', //Sets the name for the 'volume' command.
Expand Down
4 changes: 3 additions & 1 deletion examples/basicMusicBot.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,7 @@ client.on('ready', () => {
console.log(`[Start] ${new Date()}`);
});

const music = new Music(client);
const music = new Music(client, {
youtubeKey: "some-key_here"
});
client.login(token);
2 changes: 1 addition & 1 deletion examples/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"token": "supper secret bot token here",
"sprefix": "!"
"prefix": "!"
}
Loading

0 comments on commit 6481000

Please sign in to comment.