mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 16:43:31 +01:00
refactor(ClientVoiceManager): make public, remove Client#voiceConnections (#3186)
* docs: make voice public * typings: Update typings to match the docs * typings: ClientVoiceManager is nullable in Client Co-Authored-By: vladfrangu <kingdgrizzle@gmail.com> * typings: Mark client as readonly Co-Authored-By: vladfrangu <kingdgrizzle@gmail.com> * src: Make the client readonly * src: Remove Client#voiceConnections getter in favor of ClientVoiceManager#connections
This commit is contained in:
@@ -86,7 +86,6 @@ class Client extends BaseClient {
|
||||
/**
|
||||
* The voice manager of the client (`null` in browsers)
|
||||
* @type {?ClientVoiceManager}
|
||||
* @private
|
||||
*/
|
||||
this.voice = !browser ? new ClientVoiceManager(this) : null;
|
||||
|
||||
@@ -157,16 +156,6 @@ class Client extends BaseClient {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* All active voice connections that have been established, mapped by guild ID
|
||||
* @type {Collection<Snowflake, VoiceConnection>}
|
||||
* @readonly
|
||||
*/
|
||||
get voiceConnections() {
|
||||
if (browser) return new Collection();
|
||||
return this.voice.connections;
|
||||
}
|
||||
|
||||
/**
|
||||
* All custom emojis that the client has access to, mapped by their IDs
|
||||
* @type {GuildEmojiStore<Snowflake, GuildEmoji>}
|
||||
|
||||
@@ -14,8 +14,10 @@ class ClientVoiceManager {
|
||||
/**
|
||||
* The client that instantiated this voice manager
|
||||
* @type {Client}
|
||||
* @readonly
|
||||
* @name ClientVoiceManager#client
|
||||
*/
|
||||
this.client = client;
|
||||
Object.defineProperty(this, 'client', { value: client });
|
||||
|
||||
/**
|
||||
* A collection mapping connection IDs to the Connection objects
|
||||
|
||||
Reference in New Issue
Block a user