pincer.objects.guild.thread   A
last analyzed

Complexity

Total Complexity 0

Size/Duplication

Total Lines 70
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 0
eloc 23
dl 0
loc 70
rs 10
c 0
b 0
f 0
1
# Copyright Pincer 2021-Present
0 ignored issues
show
introduced by
Missing module docstring
Loading history...
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
10
from ...utils.types import MISSING
11
12
if TYPE_CHECKING:
13
    from ...utils.types import APINullable
14
    from ...utils.snowflake import Snowflake
15
    from ...utils.timestamp import Timestamp
16
17
18
@dataclass(repr=False)
19
class ThreadMetadata(APIObject):
20
    """
21
    Represents a Discord Thread Metadata object
22
23
    Attributes
24
    ----------
25
    archived: :class:`bool`
26
        Whether the thread is archived
27
    auto_archive_duration: :class:`int`
28
        Duration in minutes to automatically archive the thread
29
        after recent activity, can be set to: 60, 1440, 4320, 10080
30
    archive_timestamp: :class:`~pincer.utils.timestamp.Timestamp`
31
        Timestamp when the thread's archive status was last changed,
32
        used for calculating recent activity
33
    locked: :class:`bool`
34
        Whether the thread is locked; when a thread is locked,
35
        only users with MANAGE_THREADS can unarchive it
36
    invitable: APINullable[:class:`bool`]
37
        Whether non-moderators can add other non-moderators to a thread;
38
        only available on private threads
39
    """
40
41
    archived: bool
42
    auto_archive_duration: int
43
    archive_timestamp: Timestamp
44
    locked: bool
45
46
    invitable: APINullable[bool] = MISSING
47
48
49
@dataclass(repr=False)
50
class ThreadMember(APIObject):
51
    """Represents a Discord Thread Member object
52
53
    Attributes
54
    ----------
55
    join_timestamp: :class:`~pincer.utils.timestamp.Timestamp`
56
        The time the current user last joined the thread
57
    flags: :class:`int`
58
        Any user-thread settings, currently only used for notifications
59
    id: APINullable[:class:`~pincer.utils.snowflake.Snowflake`]
60
        Id of the thread
61
    user_id: APINullable[:class:`~pincer.utils.snowflake.Snowflake`]
62
        Id of the user
63
    """
64
65
    join_timestamp: Timestamp
66
    flags: int
67
68
    id: APINullable[Snowflake] = MISSING
69
    user_id: APINullable[Snowflake] = MISSING
70