|
1
|
|
|
# Copyright Pincer 2021-Present |
|
|
|
|
|
|
2
|
|
|
# Full MIT License can be found in `LICENSE` at the project root. |
|
3
|
|
|
|
|
4
|
|
|
from __future__ import annotations |
|
5
|
|
|
|
|
6
|
|
|
from dataclasses import dataclass |
|
7
|
|
|
from typing import TYPE_CHECKING |
|
8
|
|
|
|
|
9
|
|
|
from ...utils.api_object import APIObject, ChannelProperty, GuildProperty |
|
10
|
|
|
from ...utils.types import MISSING |
|
11
|
|
|
|
|
12
|
|
|
if TYPE_CHECKING: |
|
13
|
|
|
from ..guild.member import GuildMember |
|
14
|
|
|
from ...utils.types import APINullable |
|
15
|
|
|
from ...utils.snowflake import Snowflake |
|
16
|
|
|
from ...utils.timestamp import Timestamp |
|
17
|
|
|
|
|
18
|
|
|
|
|
19
|
|
|
@dataclass(repr=False) |
|
20
|
|
|
class VoiceState(APIObject, ChannelProperty, GuildProperty): |
|
|
|
|
|
|
21
|
|
|
"""Used to represent a user's voice connection status |
|
22
|
|
|
|
|
23
|
|
|
Attributes |
|
24
|
|
|
---------- |
|
25
|
|
|
channel_id: APINullable[:class:`~pincer.utils.snowflake.Snowflake`] |
|
26
|
|
|
The channel id this user is connected to |
|
27
|
|
|
user_id: :class:`~pincer.utils.snowflake.Snowflake` |
|
28
|
|
|
The user id this voice state is for |
|
29
|
|
|
session_id: :class:`str` |
|
30
|
|
|
The session id for this voice state |
|
31
|
|
|
deaf: :class:`bool` |
|
32
|
|
|
Whether this user is deafened by the server |
|
33
|
|
|
mute: :class:`bool` |
|
34
|
|
|
Whether this user is muted by the server |
|
35
|
|
|
self_deaf: :class:`bool` |
|
36
|
|
|
Whether this user is locally deafened |
|
37
|
|
|
self_mute: :class:`bool` |
|
38
|
|
|
Whether this user is locally muted |
|
39
|
|
|
self_video: :class:`bool` |
|
40
|
|
|
Whether this user's camera is enabled |
|
41
|
|
|
suppress: :class:`bool` |
|
42
|
|
|
Whether this user is muted by the current user |
|
43
|
|
|
request_to_speak_timestamp: Optional[:class:`~pincer.utils.timestamp.Timestamp`] |
|
44
|
|
|
The time at which the user requested to speak |
|
45
|
|
|
guild_id: APINullable[:class:`~pincer.utils.snowflake.Snowflake`] |
|
46
|
|
|
The guild id this voice state is for |
|
47
|
|
|
member: APINullable[:class:`~pincer.objects.guild.member.GuildMember`] |
|
48
|
|
|
The guild member this voice state is for |
|
49
|
|
|
self_stream: APINullable[:class:`bool`] |
|
50
|
|
|
Whether this user is streaming using "Go Live" |
|
51
|
|
|
""" |
|
52
|
|
|
|
|
53
|
|
|
# noqa: E501 |
|
54
|
|
|
|
|
55
|
|
|
user_id: Snowflake |
|
56
|
|
|
session_id: str |
|
57
|
|
|
deaf: bool |
|
58
|
|
|
mute: bool |
|
59
|
|
|
self_deaf: bool |
|
60
|
|
|
self_mute: bool |
|
61
|
|
|
self_video: bool |
|
62
|
|
|
suppress: bool |
|
63
|
|
|
|
|
64
|
|
|
channel_id: APINullable[Snowflake] = MISSING |
|
65
|
|
|
request_to_speak_timestamp: APINullable[Timestamp] = MISSING |
|
66
|
|
|
guild_id: APINullable[Snowflake] = MISSING |
|
67
|
|
|
member: APINullable[GuildMember] = MISSING |
|
68
|
|
|
self_stream: APINullable[bool] = MISSING |
|
69
|
|
|
|