Completed
Push — main ( 3a3ea0...93fa25 )
by Yohann
23s queued 12s
created

pincer.objects.guild.template   A

Complexity

Total Complexity 0

Size/Duplication

Total Lines 67
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 0
eloc 22
dl 0
loc 67
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 Optional, TYPE_CHECKING
8
9
from ...utils import APIObject
10
11
if TYPE_CHECKING:
12
    from ..guild import Guild
13
    from ..user import User
14
    from ...utils import Snowflake, Timestamp
15
16
17
@dataclass
0 ignored issues
show
best-practice introduced by
Too many instance attributes (11/7)
Loading history...
18
class GuildTemplate(APIObject):
19
    """
20
    Represents a code that when used,
21
    creates a guild based on a snapshot of an existing guild.
22
23
    :param code:
24
        the template code (unique ID)
25
26
    :param name:
27
        template name
28
29
    :param description:
30
        the description for the template
31
32
    :param usage_count:
33
        number of times this template has been used
34
35
    :param creator_id:
36
        the ID of the user who created the template
37
38
    :param creator: the
39
        user who created the template
40
41
    :param created_at:
42
        when this template was created
43
44
    :param updated_at:
45
        when this template was last synced to the source guild
46
47
    :param source_guild_id:
48
        the ID of the guild this template is based on
49
50
    :param serialized_source_guild:
51
        the guild snapshot this template contains
52
53
    :param is_dirty:
54
        whether the template has unsynced changes
55
    """
56
    code: str
57
    name: str
58
    description: Optional[str]
59
    usage_count: int
60
    creator_id: Snowflake
0 ignored issues
show
introduced by
The variable Snowflake does not seem to be defined in case TYPE_CHECKING on line 11 is False. Are you sure this can never be the case?
Loading history...
61
    creator: User
0 ignored issues
show
introduced by
The variable User does not seem to be defined in case TYPE_CHECKING on line 11 is False. Are you sure this can never be the case?
Loading history...
62
    created_at: Timestamp
0 ignored issues
show
introduced by
The variable Timestamp does not seem to be defined in case TYPE_CHECKING on line 11 is False. Are you sure this can never be the case?
Loading history...
63
    updated_at: Timestamp
64
    source_guild_id: Snowflake
65
    serialized_source_guild: Guild
0 ignored issues
show
introduced by
The variable Guild does not seem to be defined in case TYPE_CHECKING on line 11 is False. Are you sure this can never be the case?
Loading history...
66
    is_dirty: Optional[bool]
67