Skip to content

~.cache

Cache

VoiceChannelMetadata dataclass

VoiceChannelMetadata(
    active: set[hikari.Snowflake],
    guild_id: hikari.Snowflake,
    id: hikari.Snowflake,
    members: dict[hikari.Snowflake, hikari.Member],
)

Metadata container for a voice channel.

active instance-attribute

active: set[hikari.Snowflake]

A set of all actively speaking users in this channel.

guild_id instance-attribute

guild_id: hikari.Snowflake

The ID of the guild this channel is in.

id instance-attribute

The ID of this channel.

members instance-attribute

All members within this channel.

Cache

Cache(client: VoiceClient)

Cache management implementation.

Create a new cache management instance.

PARAMETER DESCRIPTION
client

The controlling voice system client.

TYPE: VoiceClient

check_ssrc_connected

check_ssrc_connected(ssrc: int) -> bool

Check if the provided SSRC maps to a connected user.

PARAMETER DESCRIPTION
ssrc

The SSRC of the user.

TYPE: int

RETURNS DESCRIPTION
bool

If the SSRC maps to a user, thus being connected.

clear

clear() -> None

Clear all internal data.

delete_channel_metadata

delete_channel_metadata(
    channel_id: hikari.Snowflake,
) -> VoiceChannelMetadata | None

Delete metadata for a specific channel.

PARAMETER DESCRIPTION
channel_id

The ID of the channel to clear.

TYPE: hikari.Snowflake

RETURNS DESCRIPTION
VoiceChannelMetadata | None

The deleted metadata, if found.

delete_member

delete_member(member_id: hikari.Snowflake) -> None

Delete a member mapping to a channel.

PARAMETER DESCRIPTION
member_id

The ID of the member to remove.

TYPE: hikari.Snowflake

delete_ssrc

delete_ssrc(member_id: hikari.Snowflake) -> None

Delete/disassociate a SSRC with a member.

PARAMETER DESCRIPTION
member_id

The ID of the member to disassociate SSRCs with.

TYPE: hikari.Snowflake

get_channel_member_ids

get_channel_member_ids(
    channel_id: hikari.Snowflake,
) -> list[hikari.Snowflake]

Get a list of all members within a channel.

PARAMETER DESCRIPTION
channel_id

The ID of the channel.

TYPE: hikari.Snowflake

RETURNS DESCRIPTION
list[hikari.Snowflake]

All members within the channel.

get_channel_metadata

get_channel_metadata(
    channel_id: hikari.Snowflake,
) -> VoiceChannelMetadata | None

Get the metadata for a channel.

PARAMETER DESCRIPTION
channel_id

The ID of the channel.

TYPE: hikari.Snowflake

RETURNS DESCRIPTION
VoiceChannelMetadata | None

The channel metadata, if found.

get_member_channel

get_member_channel(
    member_id: hikari.Snowflake,
) -> hikari.Snowflake | None

Get the channel a member is in.

PARAMETER DESCRIPTION
member_id

The ID of the member.

TYPE: hikari.Snowflake

RETURNS DESCRIPTION
hikari.Snowflake | None

The ID of the channel, if found.

get_ssrc_member

get_ssrc_member(ssrc: int) -> hikari.Snowflake | None

Get the member associated with a SSRC.

PARAMETER DESCRIPTION
ssrc

The SSRC of the member.

TYPE: int

RETURNS DESCRIPTION
hikari.Snowflake | None

The ID of the member associated with this SSRC.

set_channel_metadata

set_channel_metadata(
    channel_id: hikari.Snowflake,
    metadata: VoiceChannelMetadata,
) -> None

Set the metadata for a channel.

PARAMETER DESCRIPTION
channel_id

The ID of the channel.

TYPE: hikari.Snowflake

metadata

The metadata for this channel.

TYPE: VoiceChannelMetadata

set_member_channel

set_member_channel(
    member_id: hikari.Snowflake,
    channel_id: hikari.Snowflake,
) -> None

Set the channel that a member is in.

PARAMETER DESCRIPTION
member_id

The ID of the member.

TYPE: hikari.Snowflake

channel_id

The ID of the channel.

TYPE: hikari.Snowflake

set_member_ssrc

set_member_ssrc(
    member_id: hikari.Snowflake, ssrc: int
) -> None

Associate a SSRC with a member.

PARAMETER DESCRIPTION
member_id

The ID of the member.

TYPE: hikari.Snowflake

ssrc

The SSRC to associate.

TYPE: int

set_member_state

set_member_state(
    member_id: hikari.Snowflake, mute: bool, deaf: bool
) -> None

Set the state of a member.

PARAMETER DESCRIPTION
member_id

The ID of the member.

TYPE: hikari.Snowflake

mute

If this member is muted.

TYPE: bool

deaf

If this member is deafened.

TYPE: bool