mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-13 10:03:31 +01:00
VoiceConnection rework (#1183)
* VoiceConnection rework - improves codebase - removes concept of pending connections - attempts to fix memory leaks by removing EventEmitter listeners - makes voice connections keep track of its own channel when it is moved by another user - allows voice connections to reconnect when Discord falls back to another voice server or a region change occurs - adds events for some of the aforementioned events * Removed unused code * More clean up / bugfixes * Added typedefs to Status and VoiceStatus constants
This commit is contained in:
@@ -163,6 +163,16 @@ const Endpoints = exports.Endpoints = {
|
||||
emoji: (emojiID) => `${Endpoints.CDN}/emojis/${emojiID}.png`,
|
||||
};
|
||||
|
||||
/**
|
||||
* The current status of the client. Here are the available statuses:
|
||||
* - READY
|
||||
* - CONNECTING
|
||||
* - RECONNECTING
|
||||
* - IDLE
|
||||
* - NEARLY
|
||||
* - DISCONNECTED
|
||||
* @typedef {number} Status
|
||||
*/
|
||||
exports.Status = {
|
||||
READY: 0,
|
||||
CONNECTING: 1,
|
||||
@@ -172,6 +182,23 @@ exports.Status = {
|
||||
DISCONNECTED: 5,
|
||||
};
|
||||
|
||||
/**
|
||||
* The current status of a voice connection. Here are the available statuses:
|
||||
* - CONNECTED
|
||||
* - CONNECTING
|
||||
* - AUTHENTICATING
|
||||
* - RECONNECTING
|
||||
* - DISCONNECTED
|
||||
* @typedef {number} VoiceStatus
|
||||
*/
|
||||
exports.VoiceStatus = {
|
||||
CONNECTED: 0,
|
||||
CONNECTING: 1,
|
||||
AUTHENTICATING: 2,
|
||||
RECONNECTING: 3,
|
||||
DISCONNECTED: 4,
|
||||
};
|
||||
|
||||
exports.ChannelTypes = {
|
||||
text: 0,
|
||||
DM: 1,
|
||||
|
||||
Reference in New Issue
Block a user