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:
Vlad Frangu
2019-04-08 15:20:53 +03:00
committed by SpaceEEC
parent 152d2e88bd
commit 70d4b4455b
3 changed files with 17 additions and 18 deletions

View File

@@ -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>}