mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-14 02:23:31 +01:00
docs(WIP): Bring the main doc pages up to date, and add more examples (#2094)
* Bring some docs up to date, as well as add a new example * Missed an exclamation mark * Do requested changes * Do suggestions * Same suggestions for the other examples * Show people that they can also use reply with embeds * Typos in embed.js example * Remove object example from embeds, too complex Suggested by Yukine * Some changes, some requested changes * Add moderation examples! * Add attachment examples * Missing dot * Fix spacing * Requested Changes * Quote consistency * Tfw you break the syntax
This commit is contained in:
@@ -4,12 +4,16 @@ Voice in discord.js can be used for many things, such as music bots, recording o
|
||||
In discord.js, you can use voice by connecting to a `VoiceChannel` to obtain a `VoiceConnection`, where you can start streaming and receiving audio.
|
||||
|
||||
To get started, make sure you have:
|
||||
* ffmpeg - `npm install ffmpeg-binaries`
|
||||
* FFmpeg - `npm install ffmpeg-binaries`
|
||||
* an opus encoder, choose one from below:
|
||||
* `npm install node-opus` (better performance)
|
||||
* `npm install opusscript`
|
||||
* 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.
|
||||
|
||||
## Joining a voice channel
|
||||
The example below reacts to a message and joins the sender's voice channel, catching any errors. This is important
|
||||
as it allows us to obtain a `VoiceConnection` that we can start to stream audio with.
|
||||
@@ -132,4 +136,4 @@ connection.play(broadcast);
|
||||
It's important to note that the `dispatcher` stored above is a `BroadcastDispatcher` - it controls all the dispatcher subscribed to the broadcast, e.g. setting the volume of this dispatcher affects the volume of all subscribers.
|
||||
|
||||
## Voice Receive
|
||||
coming soon™
|
||||
coming soon™
|
||||
|
||||
Reference in New Issue
Block a user