| Total Complexity | 0 |
| Total Lines | 67 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | # Copyright Pincer 2021-Present |
||
|
|
|||
| 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 |
||
| 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 |
||
| 61 | creator: User |
||
| 62 | created_at: Timestamp |
||
| 63 | updated_at: Timestamp |
||
| 64 | source_guild_id: Snowflake |
||
| 65 | serialized_source_guild: Guild |
||
| 66 | is_dirty: Optional[bool] |
||
| 67 |