docs: replace all occurances of node-opus with @discordjs/opus (#3698)

* docs: replace all occurances of node-opus with @discordjs/opus

* chore: leave in node-opus in case not everyone switched
This commit is contained in:
Crawl
2020-01-16 14:10:48 +01:00
committed by GitHub
parent d096e40f6f
commit 6a0fe467e5
6 changed files with 19 additions and 18 deletions

View File

@@ -11,7 +11,7 @@ To get ready to work on the codebase, please do the following:
1. Fork & clone the repository, and make sure you're on the **master** branch 1. Fork & clone the repository, and make sure you're on the **master** branch
2. Run `npm install` 2. Run `npm install`
3. If you're working on voice, also run `npm install node-opus` or `npm install opusscript` 3. If you're working on voice, also run `npm install @discordjs/opus` or `npm install opusscript`
4. Code your heart out! 4. Code your heart out!
5. Run `npm test` to run ESLint and ensure any JSDoc changes are valid 5. Run `npm test` to run ESLint and ensure any JSDoc changes are valid
6. [Submit a pull request](https://github.com/discordjs/discord.js/compare) 6. [Submit a pull request](https://github.com/discordjs/discord.js/compare)

View File

@@ -42,13 +42,13 @@ discord.js is a powerful [Node.js](https://nodejs.org) module that allows you to
Ignore any warnings about unmet peer dependencies, as they're all optional. Ignore any warnings about unmet peer dependencies, as they're all optional.
Without voice support: `npm install discordjs/discord.js` Without voice support: `npm install discordjs/discord.js`
With voice support ([node-opus](https://www.npmjs.com/package/node-opus)): `npm install discordjs/discord.js node-opus` With voice support ([@discordjs/opus](https://www.npmjs.com/package/@discordjs/opus)): `npm install discordjs/discord.js @discordjs/opus`
With voice support ([opusscript](https://www.npmjs.com/package/opusscript)): `npm install discordjs/discord.js opusscript` With voice support ([opusscript](https://www.npmjs.com/package/opusscript)): `npm install discordjs/discord.js opusscript`
### Audio engines ### Audio engines
The preferred audio engine is node-opus, as it performs significantly better than opusscript. When both are available, discord.js will automatically choose node-opus. The preferred audio engine is @discordjs/opus, as it performs significantly better than opusscript. When both are available, discord.js will automatically choose @discordjs/opus.
Using opusscript is only recommended for development environments where node-opus is tough to get working. Using opusscript is only recommended for development environments where @discordjs/opus is tough to get working.
For production bots, using node-opus should be considered a necessity, especially if they're going to be running on multiple servers. For production bots, using @discordjs/opus should be considered a necessity, especially if they're going to be running on multiple servers.
### Optional packages ### Optional packages
- [zlib-sync](https://www.npmjs.com/package/zlib-sync) for faster WebSocket data inflation (`npm install zlib-sync`) - [zlib-sync](https://www.npmjs.com/package/zlib-sync) for faster WebSocket data inflation (`npm install zlib-sync`)

View File

@@ -7,8 +7,8 @@ Update to Node.js 10.0.0 or newer.
## How do I get voice working? ## How do I get voice working?
- Install FFMPEG. - Install FFMPEG.
- Install either the `node-opus` package or the `opusscript` package. - Install either the `@discordjs/opus` package or the `opusscript` package.
node-opus is greatly preferred, due to it having significantly better performance. @discordjs/opus is greatly preferred, due to it having significantly better performance.
## How do I install FFMPEG? ## How do I install FFMPEG?
- **npm:** `npm install ffmpeg-binaries` - **npm:** `npm install ffmpeg-binaries`
@@ -16,10 +16,10 @@ Update to Node.js 10.0.0 or newer.
- **Ubuntu 14.04:** `sudo apt-get install libav-tools` - **Ubuntu 14.04:** `sudo apt-get install libav-tools`
- **Windows:** `npm install ffmpeg-binaries` or see the [FFMPEG section of AoDude's guide](https://github.com/bdistin/OhGodMusicBot/blob/master/README.md#download-ffmpeg). - **Windows:** `npm install ffmpeg-binaries` or see the [FFMPEG section of AoDude's guide](https://github.com/bdistin/OhGodMusicBot/blob/master/README.md#download-ffmpeg).
## How do I set up node-opus? ## How do I set up @discordjs/opus?
- **Ubuntu:** Simply run `npm install node-opus`, and it's done. Congrats! - **Ubuntu:** Simply run `npm install @discordjs/opus`, and it's done. Congrats!
- **Windows:** Run `npm install --global --production windows-build-tools` in an admin command prompt or PowerShell. - **Windows:** Run `npm install --global --production windows-build-tools` in an admin command prompt or PowerShell.
Then, running `npm install node-opus` in your bot's directory should successfully build it. Woo! Then, running `npm install @discordjs/opus` in your bot's directory should successfully build it. Woo!
Other questions can be found at the [official Discord.js guide](https://discordjs.guide/popular-topics/common-questions.html) Other questions can be found at the [official Discord.js guide](https://discordjs.guide/popular-topics/common-questions.html)
If you have issues not listed here or on the guide, feel free to ask in the [official Discord.js server](https://discord.gg/bRCvFy9). If you have issues not listed here or on the guide, feel free to ask in the [official Discord.js server](https://discord.gg/bRCvFy9).

View File

@@ -37,13 +37,13 @@ discord.js is a powerful [Node.js](https://nodejs.org) module that allows you to
Ignore any warnings about unmet peer dependencies, as they're all optional. Ignore any warnings about unmet peer dependencies, as they're all optional.
Without voice support: `npm install discordjs/discord.js` Without voice support: `npm install discordjs/discord.js`
With voice support ([node-opus](https://www.npmjs.com/package/node-opus)): `npm install discordjs/discord.js node-opus` With voice support ([@discordjs/opus](https://www.npmjs.com/package/@discordjs/opus)): `npm install discordjs/discord.js @discordjs/opus`
With voice support ([opusscript](https://www.npmjs.com/package/opusscript)): `npm install discordjs/discord.js opusscript` With voice support ([opusscript](https://www.npmjs.com/package/opusscript)): `npm install discordjs/discord.js opusscript`
### Audio engines ### Audio engines
The preferred audio engine is node-opus, as it performs significantly better than opusscript. When both are available, discord.js will automatically choose node-opus. The preferred audio engine is @discordjs/opus, as it performs significantly better than opusscript. When both are available, discord.js will automatically choose @discordjs/opus.
Using opusscript is only recommended for development environments where node-opus is tough to get working. Using opusscript is only recommended for development environments where @discordjs/opus is tough to get working.
For production bots, using node-opus should be considered a necessity, especially if they're going to be running on multiple servers. For production bots, using @discordjs/opus should be considered a necessity, especially if they're going to be running on multiple servers.
### Optional packages ### Optional packages
- [zlib-sync](https://www.npmjs.com/package/zlib-sync) for faster WebSocket data inflation (`npm install zlib-sync`) - [zlib-sync](https://www.npmjs.com/package/zlib-sync) for faster WebSocket data inflation (`npm install zlib-sync`)

View File

@@ -6,13 +6,13 @@ In discord.js, you can use voice by connecting to a `VoiceChannel` to obtain a `
To get started, make sure you have: To get started, make sure you have:
* FFmpeg - `npm install ffmpeg-static` * FFmpeg - `npm install ffmpeg-static`
* an opus encoder, choose one from below: * an opus encoder, choose one from below:
* `npm install node-opus` (better performance) * `npm install @discordjs/opus` (better performance)
* `npm install opusscript` * `npm install opusscript`
* a good network connection * a good network connection
The preferred opus engine is node-opus, as it performs significantly better than opusscript. When both are available, discord.js will automatically choose node-opus. The preferred opus engine is @discordjs/opus, as it performs significantly better than opusscript. When both are available, discord.js will automatically choose @discordjs/opus.
Using opusscript is only recommended for development environments where node-opus is tough to get working. Using opusscript is only recommended for development environments where @discordjs/opus is tough to get working.
For production bots, using node-opus should be considered a necessity, especially if they're going to be running on multiple servers. For production bots, using @discordjs/opus should be considered a necessity, especially if they're going to be running on multiple servers.
## Joining a voice channel ## Joining a voice channel
The example below reacts to a message and joins the sender's voice channel, catching any errors. This is important The example below reacts to a message and joins the sender's voice channel, catching any errors. This is important

View File

@@ -90,6 +90,7 @@
"node": ">=10.2.0" "node": ">=10.2.0"
}, },
"browser": { "browser": {
"@discordjs/opus": false,
"https": false, "https": false,
"ws": false, "ws": false,
"erlpack": false, "erlpack": false,