Add internal support for @discordjs/opus to v11 (#3700)

* Add internal support for @discordjs/opus

* Remove redundant try/catch

* fix: use setBitrate method in @discordjs/opus

* chore: tidy up opus imports

* fix: correct imports for DiscordJsOpusEngine

* chore: update docs to prefer @discordjs/opus

* chore: bump prism-media to 0.0.4 to allow ffmpeg-static
This commit is contained in:
Amish Shah
2020-01-17 20:58:49 +00:00
committed by GitHub
parent 36c0496ea5
commit 6ab46491c8
10 changed files with 62 additions and 33 deletions

View File

@@ -7,12 +7,12 @@ To get started, make sure you have:
* FFmpeg - `npm install ffmpeg-binaries`
* an opus encoder, choose one from below:
* `npm install opusscript`
* `npm install node-opus`
* `npm install @discordjs/opus`
* 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.
Using opusscript is only recommended for development environments where node-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.
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 @discordjs/opus is tough to get working.
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
The example below reacts to a message and joins the sender's voice channel, catching any errors. This is important