Voice

discord_http.voice module

class discord_http.voice.PartialVoiceState(*, state, id, channel_id=None, guild_id=None)

Bases: PartialBase

Represents a partial voice state object.

Parameters:
id: int

The ID of the user this voice state belongs to.

channel_id: int | None

The ID of the voice channel this user is in, if any.

guild_id: int | None

The ID of the guild this voice state is in, if any.

async fetch() VoiceState

Fetches the voice state of the member.

Return type:

VoiceState

Returns:

The voice state of the member

Raises:

NotFound

  • If the member is not in the guild - If the member is not in a voice channel

async edit(*, suppress=<MISSING>) None

Updates the voice state of the member.

Parameters:

suppress (bool) – Whether to suppress the user

Return type:

None

property created_at: datetime

The datetime of the snowflake.

class discord_http.voice.VoiceState(*, state, data, guild, channel)

Bases: PartialVoiceState

Represents a voice state object.

Parameters:
session_id: str

The session ID of the voice state.

user: PartialUser

The user this voice state belongs to.

member: Member | None

The member this voice state belongs to, if any.

channel: BaseChannel | PartialChannel | None

The voice channel this user is in, if any.

guild: PartialGuild | None

The guild this voice state is in, if any.

deaf: bool

Whether the user is deafened by the server.

channel_id: int | None

The ID of the voice channel this user is in, if any.

property created_at: datetime

The datetime of the snowflake.

async edit(*, suppress=<MISSING>) None

Updates the voice state of the member.

Parameters:

suppress (bool) – Whether to suppress the user

Return type:

None

async fetch() VoiceState

Fetches the voice state of the member.

Return type:

VoiceState

Returns:

The voice state of the member

Raises:

NotFound

  • If the member is not in the guild - If the member is not in a voice channel

guild_id: int | None

The ID of the guild this voice state is in, if any.

id: int

The ID of the user this voice state belongs to.

mute: bool

Whether the user is muted by the server.

self_deaf: bool

Whether the user is deafened by themselves.

self_mute: bool

Whether the user is muted by themselves.

self_stream: bool

Whether the user is streaming.

self_video: bool

Whether the user is using video.

suppress: bool

Whether the user is suppressed by the server.

request_to_speak_timestamp: datetime | None

The timestamp when the user requested to speak, if any.