VoiceManager
Defined in: packages/voice/src/connection.ts:558
client.voice: one VoiceConnection per guild, wired to the
client’s Gateway. The client forwards its own voice events and guild
removals here, and destroys every connection when it is destroyed.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new VoiceManager(
client,defaults?):VoiceManager
Defined in: packages/voice/src/connection.ts:564
Parameters
Section titled “Parameters”client
Section titled “client”defaults?
Section titled “defaults?”Partial<VoiceJoinOptions> = {}
Returns
Section titled “Returns”VoiceManager
Accessors
Section titled “Accessors”connections
Section titled “connections”Get Signature
Section titled “Get Signature”get connections():
ReadonlyMap<string,VoiceConnection>
Defined in: packages/voice/src/connection.ts:573
Live connections by guild.
Returns
Section titled “Returns”ReadonlyMap<string, VoiceConnection>
Methods
Section titled “Methods”destroy()
Section titled “destroy()”destroy(
leave?):void
Defined in: packages/voice/src/connection.ts:664
Destroys every connection.
Parameters
Section titled “Parameters”leave?
Section titled “leave?”boolean = true
Send op 4 to leave each channel (default true).
Returns
Section titled “Returns”void
get(
guildId):VoiceConnection|undefined
Defined in: packages/voice/src/connection.ts:578
The connection for a guild, if any.
Parameters
Section titled “Parameters”guildId
Section titled “guildId”string
Returns
Section titled “Returns”VoiceConnection | undefined
join()
Section titled “join()”join(
options):Promise<VoiceConnection>
Defined in: packages/voice/src/connection.ts:588
Joins a voice channel (or moves the guild’s connection) and resolves once audio can flow.
Parameters
Section titled “Parameters”options
Section titled “options”Returns
Section titled “Returns”Promise<VoiceConnection>
Throws
Section titled “Throws”If the guild is not on this
client’s shard, or it is not ready within timeout (the connection is
then left disconnected; rejoin() or leave() it).
leave()
Section titled “leave()”leave(
guildId):boolean
Defined in: packages/voice/src/connection.ts:638
Leaves a guild’s channel and destroys its connection.
Parameters
Section titled “Parameters”guildId
Section titled “guildId”string
Returns
Section titled “Returns”boolean
Whether there was one.