Total Complexity | 0 |
Total Lines | 36 |
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 dataclasses import dataclass |
||
5 | from typing import Optional, Union |
||
6 | |||
7 | from .guild_member import GuildMember |
||
8 | from .user import User |
||
9 | from ..utils.snowflake import Snowflake |
||
10 | |||
11 | |||
12 | @dataclass |
||
13 | class MessageContext: |
||
14 | """ |
||
15 | Represents the context of a message interaction. |
||
16 | |||
17 | :param id: |
||
18 | The ID of the interaction. |
||
19 | |||
20 | :param author: |
||
21 | The user whom invoked the interaction. |
||
22 | |||
23 | :param guild_id: |
||
24 | The ID of the guild the interaction was invoked in. |
||
25 | Can be None if it wasn't invoked in a guild. |
||
26 | |||
27 | :param channel_id: |
||
28 | The ID of the channel the interaction was invoked in. |
||
29 | Can be None if it wasn't invoked in a channel. |
||
30 | """ |
||
31 | id: Snowflake |
||
32 | author: Union[GuildMember, User] |
||
33 | |||
34 | guild_id: Optional[Snowflake] = None |
||
35 | channel_id: Optional[Snowflake] = None |
||
36 |