Total Complexity | 0 |
Total Lines | 80 |
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 TYPE_CHECKING |
||
8 | |||
9 | from ...utils.api_object import APIObject |
||
10 | from ...utils.types import MISSING |
||
11 | |||
12 | if TYPE_CHECKING: |
||
13 | from ...utils import APINullable, Snowflake |
||
14 | |||
15 | |||
16 | @dataclass |
||
17 | class RoleTags(APIObject): |
||
18 | """ |
||
19 | Special tags/flags which have been defined for a role. |
||
20 | |||
21 | :bot_id: |
||
22 | The id of the bot this role belongs to. |
||
23 | (the role got created by adding the bot with this id) |
||
24 | |||
25 | :integration_id: |
||
26 | The id of the integration this role belongs to. |
||
27 | (the role got created by adding an integration with this id) |
||
28 | |||
29 | :premium_subscriber: |
||
30 | Whether this is the guild's premium subscriber role or not. |
||
31 | """ |
||
32 | bot_id: APINullable[Snowflake] = MISSING |
||
33 | integration_id: APINullable[Snowflake] = MISSING |
||
34 | premium_subscriber: APINullable[bool] = MISSING |
||
35 | |||
36 | |||
37 | @dataclass |
||
38 | class Role(APIObject): |
||
39 | """ |
||
40 | Represents a Discord guild/server role. |
||
41 | |||
42 | :param color: |
||
43 | integer representation of hexadecimal color code |
||
44 | |||
45 | :param hoist: |
||
46 | if this role is pinned in the user listing |
||
47 | |||
48 | :param id: |
||
49 | role id |
||
50 | |||
51 | :param managed: |
||
52 | whether this role is managed by an integration |
||
53 | |||
54 | :param mentionable: |
||
55 | whether this role is mentionable |
||
56 | |||
57 | :param name: |
||
58 | role name |
||
59 | |||
60 | :param permissions: |
||
61 | permission bit set |
||
62 | |||
63 | :param position: |
||
64 | position of this role |
||
65 | |||
66 | :param tags: |
||
67 | the tags this role has |
||
68 | """ |
||
69 | |||
70 | color: int |
||
71 | hoist: bool |
||
72 | id: Snowflake |
||
73 | managed: bool |
||
74 | mentionable: bool |
||
75 | name: str |
||
76 | permissions: str |
||
77 | position: int |
||
78 | |||
79 | tags: APINullable[RoleTags] = MISSING |
||
80 |