hikariwave.client
Client
VoiceClient
VoiceClient(
bot: hikari.GatewayBot, *, config: Config | None = None
)
Voice system implementation for hikari-based gateway applications.
Create a new voice system client.
| PARAMETER | DESCRIPTION |
|---|---|
bot
|
The
TYPE:
|
config
|
If provided, the global configuration settings.
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
ClientError
|
If a voice client is already active in this process. |
TypeError
|
|
connections
property
connections: Mapping[GuildID, VoiceConnection]
A live view of all active voice connections.
close
async
close() -> None
Disconnect each connection and clean up.
connect
async
connect(
guild_id: hikari.Snowflakeish,
channel_id: hikari.Snowflakeish,
*,
mute: bool = False,
deaf: bool = True
) -> VoiceConnection
Connect to a voice channel.
| PARAMETER | DESCRIPTION |
|---|---|
guild_id
|
The ID of the guild to connect to.
TYPE:
|
channel_id
|
The ID of the voice channel to connect to.
TYPE:
|
mute
|
If the bot should be muted upon joining the voice channel.
TYPE:
|
deaf
|
If the bot should be deafened upon joining the voice channel.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
VoiceConnection
|
Once fully connected, the active voice connection to this guild/channel. |
| RAISES | DESCRIPTION |
|---|---|
asyncio.TimeoutError
|
If Discord fails to send a corresponding voice server/state update. |
ClientError
|
|
TypeError
|
|
disconnect
async
disconnect(
*,
guild_id: hikari.Snowflakeish | None = None,
channel_id: hikari.Snowflakeish | None = None
) -> None
Disconnect from a voice channel.
| PARAMETER | DESCRIPTION |
|---|---|
guild_id
|
If provided, the ID of the guild that is connected.
TYPE:
|
channel_id
|
If provided, the ID of the voice channel that is connected.
TYPE:
|
Note
Either guild_id or channel_id must be provided.
| RAISES | DESCRIPTION |
|---|---|
ClientError
|
If no active connection to the guild/channel exists. |
TypeError
|
If |
ValueError
|
If neither |
get_connection
get_connection(
*,
guild_id: hikari.Snowflakeish | None = None,
channel_id: hikari.Snowflakeish | None = None
) -> VoiceConnection | None
Get an active voice connection.
| PARAMETER | DESCRIPTION |
|---|---|
guild_id
|
If provided, the ID of the guild that is connected.
TYPE:
|
channel_id
|
If provided, the ID of the voice channel that is connected.
TYPE:
|
Note
Either guild_id or channel_id must be provided.
| RETURNS | DESCRIPTION |
|---|---|
VoiceConnection | None
|
If found, the active voice connection to the guild/channel. |
| RAISES | DESCRIPTION |
|---|---|
TypeError
|
If |
ValueError
|
If neither |
move
async
move(
new_channel_id: hikari.Snowflakeish,
*,
guild_id: hikari.Snowflakeish | None = None,
old_channel_id: hikari.Snowflakeish | None = None,
mute: bool = False,
deaf: bool = True
) -> VoiceConnection
Move to another voice channel (disconnect from old, connect to new).
| PARAMETER | DESCRIPTION |
|---|---|
new_channel_id
|
The ID of the new voice channel to move to (connect).
TYPE:
|
guild_id
|
If provided, the ID of the guild of the connection.
TYPE:
|
old_channel_id
|
If provided, the ID of the old voice channel to move from (disconnect).
TYPE:
|
mute
|
If the bot should be muted upon moving channels.
TYPE:
|
deaf
|
If the bot should be deafened upon moving channels.
TYPE:
|
Note
Either guild_id or old_channel_id must be provided.
| RETURNS | DESCRIPTION |
|---|---|
VoiceConnection
|
Once fully connected, the active voice connection to this guild/new channel. |
| RAISES | DESCRIPTION |
|---|---|
asyncio.TimeoutError
|
If Discord fails to send a corresponding voice server/state update. |
ClientError
|
|
TypeError
|
|
ValueError
|
If neither of |