Passed
Push — main ( 1b0fe2...c2859a )
by
unknown
02:05 queued 12s
created

pincer.objects.message_context   A

Complexity

Total Complexity 0

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 0
eloc 12
dl 0
loc 36
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 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