1
|
|
|
# -*- coding: utf-8 -*- |
|
|
|
|
2
|
|
|
# MIT License |
3
|
|
|
# |
4
|
|
|
# Copyright (c) 2021 Pincer |
5
|
|
|
# |
6
|
|
|
# Permission is hereby granted, free of charge, to any person obtaining |
7
|
|
|
# a copy of this software and associated documentation files |
8
|
|
|
# (the "Software"), to deal in the Software without restriction, |
9
|
|
|
# including without limitation the rights to use, copy, modify, merge, |
10
|
|
|
# publish, distribute, sublicense, and/or sell copies of the Software, |
11
|
|
|
# and to permit persons to whom the Software is furnished to do so, |
12
|
|
|
# subject to the following conditions: |
13
|
|
|
# |
14
|
|
|
# The above copyright notice and this permission notice shall be |
15
|
|
|
# included in all copies or substantial portions of the Software. |
16
|
|
|
# |
17
|
|
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
18
|
|
|
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
19
|
|
|
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
20
|
|
|
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY |
21
|
|
|
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, |
22
|
|
|
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE |
23
|
|
|
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
24
|
|
|
|
25
|
|
|
from dataclasses import dataclass |
26
|
|
|
from typing import Optional |
27
|
|
|
|
28
|
|
|
from pincer.objects.guild_member import GuildMember |
29
|
|
|
from pincer.utils.api_object import APIObject |
30
|
|
|
from pincer.utils.snowflake import Snowflake |
31
|
|
|
from pincer.utils.constants import MISSING, APINullable |
32
|
|
|
from pincer.utils.timestamp import Timestamp |
|
|
|
|
33
|
|
|
|
34
|
|
|
@dataclass |
|
|
|
|
35
|
|
|
class VoiceState(APIObject): |
36
|
|
|
""" |
37
|
|
|
Used to represent a user's voice connection status |
38
|
|
|
|
39
|
|
|
:param guild_id: |
40
|
|
|
the guild id this voice state is for |
41
|
|
|
|
42
|
|
|
:param channel_id: |
43
|
|
|
the channel id this user is connected to |
44
|
|
|
|
45
|
|
|
:param user_id: |
46
|
|
|
the user id this voice state is for |
47
|
|
|
|
48
|
|
|
:param member: |
49
|
|
|
the guild member this voice state is for |
50
|
|
|
|
51
|
|
|
:param session_id: |
52
|
|
|
the session id for this voice state |
53
|
|
|
|
54
|
|
|
:param deaf: |
55
|
|
|
whether this user is deafened by the server |
56
|
|
|
|
57
|
|
|
:param mute: |
58
|
|
|
whether this user is muted by the server |
59
|
|
|
|
60
|
|
|
:param self_deaf: |
61
|
|
|
whether this user is locally deafened |
62
|
|
|
|
63
|
|
|
:param self_mute: |
64
|
|
|
whether this user is locally muted |
65
|
|
|
|
66
|
|
|
:param self_stream: |
67
|
|
|
whether this user is streaming using "Go Live" |
68
|
|
|
|
69
|
|
|
:param self_video: |
70
|
|
|
whether this user's camera is enabled |
71
|
|
|
|
72
|
|
|
:param suppress: |
73
|
|
|
whether this user is muted by the current user |
74
|
|
|
|
75
|
|
|
:param request_to_speak_timestamp: |
76
|
|
|
the time at which the user requested to speak |
77
|
|
|
""" |
78
|
|
|
channel_id: Optional[Snowflake] |
79
|
|
|
user_id: Snowflake |
80
|
|
|
session_id: str |
81
|
|
|
deaf: bool |
82
|
|
|
mute: bool |
83
|
|
|
self_deaf: bool |
84
|
|
|
self_mute: bool |
85
|
|
|
self_video: bool |
86
|
|
|
suppress: bool |
87
|
|
|
request_to_speak_timestamp: Optional[Timestamp] |
88
|
|
|
|
89
|
|
|
guild_id: APINullable[Snowflake] = MISSING |
|
|
|
|
90
|
|
|
member: APINullable[GuildMember] = MISSING |
|
|
|
|
91
|
|
|
self_stream: APINullable[bool] = MISSING |
|
|
|
|
92
|
|
|
|