Passed
Pull Request — main (#44)
by
unknown
01:34
created

pincer.objects.thread   A

Complexity

Total Complexity 0

Size/Duplication

Total Lines 86
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 0
eloc 20
dl 0
loc 86
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
from __future__ import annotations
25
26
from dataclasses import dataclass
27
28
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...
29
from pincer.utils.snowflake import Snowflake
30
from pincer.utils.api_object import APIObject
31
from pincer.utils.constants import APINullable, MISSING
32
33
@dataclass
34
class ThreadMetadata(APIObject):
35
    """
36
    Represents a Discord Thread Metadata object
37
38
    :param archived:
39
        whether the thread is archived
40
41
    :param auto_archive_duration:
42
        duration in minutes to automatically archive the thread
43
        after recent activity, can be set to: 60, 1440, 4320, 10080
44
45
    :param archive_timestamp:
46
        timestamp when the thread's archive status was last changed,
47
        used for calculating recent activity
48
49
    :param locked:
50
        whether the thread is locked; when a thread is locked,
51
        only users with MANAGE_THREADS can unarchive it
52
53
    :param invitable:
54
        whether non-moderators can add other non-moderators to a thread;
55
        only available on private threads
56
    """
57
    archived: bool
58
    auto_archive_duration: int
59
    archive_timestamp: Timestamp
60
    locked: bool
61
62
    invitable: APINullable[bool] = MISSING
0 ignored issues
show
introduced by
Value 'APINullable' is unsubscriptable
Loading history...
63
64
@dataclass
65
class ThreadMember(APIObject):
66
    """
67
    Represents a Discord Thread Member object
68
69
    :param join_timestamp:
70
        the time the current user last joined the thread
71
72
    :param flags:
73
        any user-thread settings, currently only used for notifications
74
75
    :param id:
76
        id of the thread
77
78
    :param user_id:
79
        id of the user
80
    """
81
    join_timestamp: Timestamp
82
    flags: int
83
84
    id: APINullable[Snowflake] = MISSING
1 ignored issue
show
introduced by
Value 'APINullable' is unsubscriptable
Loading history...
Coding Style Naming introduced by
Attribute name "id" doesn't conform to snake_case naming style ('([^\\W\\dA-Z][^\\WA-Z]2,|_[^\\WA-Z]*|__[^\\WA-Z\\d_][^\\WA-Z]+__)$' pattern)

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
85
    user_id: APINullable[Snowflake] = MISSING
0 ignored issues
show
introduced by
Value 'APINullable' is unsubscriptable
Loading history...
86
0 ignored issues
show
coding-style introduced by
Trailing newlines
Loading history...
87