Change node-opus and opusscript to peer deps

This commit is contained in:
Schuyler Cebulskie
2016-10-14 00:52:25 -04:00
parent 485ffd267e
commit 1ef00d0fe7
3 changed files with 18 additions and 14 deletions

View File

@@ -16,12 +16,14 @@ discord.js is a powerful node.js module that allows you to interact with the [Di
## Installation ## Installation
**Node.js 6.0.0 or newer is required.** **Node.js 6.0.0 or newer is required.**
With voice support: `npm install --save discord.js --production` Without voice support: `npm install discord.js --save --production`
Without voice support: `npm install --save discord.js --production --no-optional` With voice support ([node-opus](https://www.npmjs.com/package/node-opus)): `npm install discord.js node-opus --save --production`
With voice support ([opusscript](https://www.npmjs.com/package/opusscript)): `npm install discord.js opusscript --save --production`
If both audio packages are installed, discord.js will automatically choose node-opus.
By default, discord.js uses [opusscript](https://www.npmjs.com/package/opusscript) when playing audio over voice connections. The preferred audio engine is node-opus, as it performs significantly better than opusscript.
If you're looking to play over multiple voice connections, it might be better to install [node-opus](https://www.npmjs.com/package/node-opus). Using opusscript is only recommended for development on Windows, since getting node-opus to build there can be a bit of a challenge.
discord.js will automatically prefer node-opus over opusscript. For production bots, using node-opus should be considered a necessity, especially if they're going to be running on multiple servers.
## Example Usage ## Example Usage
```js ```js

View File

@@ -20,12 +20,14 @@ stable and performant than previous versions.
## Installation ## Installation
**Node.js 6.0.0 or newer is required.** **Node.js 6.0.0 or newer is required.**
With voice support: `npm install --save discord.js --production` Without voice support: `npm install discord.js --save --production`
Without voice support: `npm install --save discord.js --production --no-optional` With voice support ([node-opus](https://www.npmjs.com/package/node-opus)): `npm install discord.js node-opus --save --production`
With voice support ([opusscript](https://www.npmjs.com/package/opusscript)): `npm install discord.js opusscript --save --production`
If both audio packages are installed, discord.js will automatically prefer node-opus.
By default, discord.js uses [opusscript](https://www.npmjs.com/package/opusscript) when playing audio over voice connections. The preferred audio engine is node-opus, as it performs significantly better than opusscript.
If you're looking to play over multiple voice connections, it might be better to install [node-opus](https://www.npmjs.com/package/node-opus). Using opusscript is only recommended for development on Windows, since getting node-opus to build there can be a bit of a challenge.
discord.js will automatically prefer node-opus over opusscript. For production bots, using node-opus should be considered a necessity, especially if they're going to be running on multiple servers.
## Guides ## Guides
* [LuckyEvie's general guide](https://eslachance.gitbooks.io/discord-js-bot-guide/content/) * [LuckyEvie's general guide](https://eslachance.gitbooks.io/discord-js-bot-guide/content/)

View File

@@ -28,7 +28,10 @@
"dependencies": { "dependencies": {
"superagent": "^2.2.0", "superagent": "^2.2.0",
"tweetnacl": "^0.14.3", "tweetnacl": "^0.14.3",
"ws": "^1.1.1", "ws": "^1.1.1"
},
"peerDependencies": {
"node-opus": "^0.2.1",
"opusscript": "^0.0.1" "opusscript": "^0.0.1"
}, },
"devDependencies": { "devDependencies": {
@@ -36,9 +39,6 @@
"jsdoc-parse": "^1.2.0", "jsdoc-parse": "^1.2.0",
"eslint": "^3.4.0" "eslint": "^3.4.0"
}, },
"optionalDependencies": {
"node-opus": "^0.2.1"
},
"engines": { "engines": {
"node": ">=6.0.0" "node": ">=6.0.0"
} }