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.
- 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:
- guild
hikari.snowflakes.SnowflakeishOr
[hikari.guilds.Guild
] The guild to connect to.
- channel
hikari.snowflakes.SnowflakeishOr
[hikari.channels.GuildVoiceChannel
] The channel or channel ID to connect to.
- voice_connection_type
typing.Type
[VoiceConnection
] The type of voice connection to use. This should be initialized internally using the
VoiceConnection.initialize
classmethod
.- deafbool
Defaulting to
False
, ifTrue
, the client will enter the voice channel deafened (thus unable to hear other users).- mutebool
Defaulting to
False
, ifTrue
, the client will enter the voice channel muted (thus unable to send audio).- timeout
typing.Optional
[int
] Defaulting to
5
, The amount of time to wait before erroring when connecting to the voice channel. If timeout isNone
there will be no timeout.Warning
If timeout is
None
, this function will be awaited forever if an invalidguild_id
orchannel_id
is provided.- **kwargs
typing.Any
Any arguments to provide to the
VoiceConnection.initialize
method.
- guild
- Returns:
VoiceConnection
A voice connection implementation of some sort.
- async disconnect(guild)[source]#
Disconnect from a given guild.
- Parameters:
- guild
hikari.snowflakes.SnowflakeishOr
[hikari.guilds.Guild
] The guild to disconnect from.
- guild