Skip to content

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.

new VoiceManager(client, defaults?): VoiceManager

Defined in: packages/voice/src/connection.ts:564

VoiceManagerClient

Partial<VoiceJoinOptions> = {}

VoiceManager

get connections(): ReadonlyMap<string, VoiceConnection>

Defined in: packages/voice/src/connection.ts:573

Live connections by guild.

ReadonlyMap<string, VoiceConnection>

destroy(leave?): void

Defined in: packages/voice/src/connection.ts:664

Destroys every connection.

boolean = true

Send op 4 to leave each channel (default true).

void


get(guildId): VoiceConnection | undefined

Defined in: packages/voice/src/connection.ts:578

The connection for a guild, if any.

string

VoiceConnection | undefined


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.

VoiceJoinOptions

Promise<VoiceConnection>

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(guildId): boolean

Defined in: packages/voice/src/connection.ts:638

Leaves a guild’s channel and destroys its connection.

string

boolean

Whether there was one.