hikari.impl.voice#

Implementation of a simple voice management system.

Module Contents#

class hikari.impl.voice.VoiceComponentImpl(app)[source]#

Bases: hikari.api.voice.VoiceComponent

A standard voice component management implementation.

This is the regular implementation you will generally use to connect to voice channels with.

property is_alive: bool[source]#

Whether this component is alive.

async close()[source]#

Shut down all connections, waiting for them to terminate.

Once this is done, unsubscribe from any events.

If you simply wish to disconnect every connection, use disconnect instead.

async connect_to(guild, channel, voice_connection_type, *, deaf=False, mute=False, timeout=5, **kwargs)[source]#

Connect to a given voice channel.

Parameters:
guildhikari.snowflakes.SnowflakeishOr[hikari.guilds.Guild]

The guild to connect to.

channelhikari.snowflakes.SnowflakeishOr[hikari.channels.GuildVoiceChannel]

The channel or channel ID to connect to.

voice_connection_typetyping.Type[VoiceConnection]

The type of voice connection to use. This should be initialized internally using the VoiceConnection.initialize classmethod.

deafbool

Defaulting to False, if True, the client will enter the voice channel deafened (thus unable to hear other users).

mutebool

Defaulting to False, if True, the client will enter the voice channel muted (thus unable to send audio).

timeouttyping.Optional[int]

Defaulting to 5, The amount of time to wait before erroring when connecting to the voice channel. If timeout is None there will be no timeout.

Warning

If timeout is None, this function will be awaited forever if an invalid guild_id or channel_id is provided.

**kwargstyping.Any

Any arguments to provide to the VoiceConnection.initialize method.

Returns:
VoiceConnection

A voice connection implementation of some sort.

async disconnect(guild)[source]#

Disconnect from a given guild.

Parameters:
guildhikari.snowflakes.SnowflakeishOr[hikari.guilds.Guild]

The guild to disconnect from.

async disconnect_all()[source]#

Disconnect all the active voice connections.

start()[source]#

Start this voice component.