Completed
Push — main ( b12314...8ccbcd )
by Yohann
17s queued 14s
created

pincer.objects.voice_state   A

Complexity

Total Complexity 0

Size/Duplication

Total Lines 92
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 0
eloc 23
dl 0
loc 92
rs 10
c 0
b 0
f 0
1
# -*- coding: utf-8 -*-
0 ignored issues
show
introduced by
Missing module docstring
Loading history...
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
0 ignored issues
show
Bug introduced by
The name timestamp does not seem to exist in module pincer.utils.
Loading history...
introduced by
Cannot import 'pincer.utils.timestamp' due to syntax error 'invalid syntax (<unknown>, line 91)'
Loading history...
33
34
@dataclass
0 ignored issues
show
best-practice introduced by
Too many instance attributes (13/7)
Loading history...
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
0 ignored issues
show
introduced by
Value 'APINullable' is unsubscriptable
Loading history...
90
    member: APINullable[GuildMember] = MISSING
0 ignored issues
show
introduced by
Value 'APINullable' is unsubscriptable
Loading history...
91
    self_stream: APINullable[bool] = MISSING
0 ignored issues
show
introduced by
Value 'APINullable' is unsubscriptable
Loading history...
92