|
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 TYPE_CHECKING |
|
8
|
|
|
|
|
9
|
|
|
from ...utils.api_object import APIObject, ChannelProperty |
|
10
|
|
|
|
|
11
|
|
|
if TYPE_CHECKING: |
|
12
|
|
|
from typing import Optional, List |
|
13
|
|
|
|
|
14
|
|
|
from ...utils.snowflake import Snowflake |
|
15
|
|
|
|
|
16
|
|
|
|
|
17
|
|
|
@dataclass(repr=False) |
|
18
|
|
|
class WelcomeScreenChannel(APIObject, ChannelProperty): |
|
19
|
|
|
"""Represents a welcome screen channel. This is a channel which gets |
|
20
|
|
|
shown on the welcome screen. |
|
21
|
|
|
|
|
22
|
|
|
Attributes |
|
23
|
|
|
---------- |
|
24
|
|
|
channel_id: :class:`~pincer.utils.snowflake.Snowflake` |
|
25
|
|
|
The channel's id |
|
26
|
|
|
description: :class:`str` |
|
27
|
|
|
The description shown for the channel |
|
28
|
|
|
emoji_id: Optional[:class:`int`] |
|
29
|
|
|
The emoji id, if the emoji is custom |
|
30
|
|
|
emoji_name: Optional[:class:`str`] |
|
31
|
|
|
The emoji name if custom, the unicode character if standard, |
|
32
|
|
|
or null if no emoji is set |
|
33
|
|
|
""" |
|
34
|
|
|
|
|
35
|
|
|
channel_id: Snowflake |
|
36
|
|
|
description: str |
|
37
|
|
|
|
|
38
|
|
|
emoji_id: Optional[int] = None |
|
39
|
|
|
emoji_name: Optional[str] = None |
|
40
|
|
|
|
|
41
|
|
|
|
|
42
|
|
|
@dataclass(repr=False) |
|
43
|
|
|
class WelcomeScreen(APIObject): |
|
44
|
|
|
"""Representation of a Discord guild/server welcome screen. |
|
45
|
|
|
|
|
46
|
|
|
Attributes |
|
47
|
|
|
---------- |
|
48
|
|
|
description: LIst[:class:`~pincer.objects.guild.welcome_screen.WelcomeScreenChannel`] |
|
49
|
|
|
The server description shown in the welcome screen |
|
50
|
|
|
welcome_channels: Optional[:class:`str`] |
|
51
|
|
|
The channels shown in the welcome screen, up to 5 |
|
52
|
|
|
""" # noqa: E501 |
|
53
|
|
|
|
|
54
|
|
|
welcome_channels: List[WelcomeScreenChannel] |
|
55
|
|
|
|
|
56
|
|
|
description: Optional[str] = None |
|
57
|
|
|
|