Completed
Push — main ( 3a3ea0...93fa25 )
by Yohann
23s queued 12s
created

pincer.objects.message.context   A

Complexity

Total Complexity 0

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 0
eloc 16
dl 0
loc 44
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
from __future__ import annotations
4
5
from dataclasses import dataclass
6
from typing import Optional, Union, TYPE_CHECKING
7
8
if TYPE_CHECKING:
9
    from ..app import ClientCommandStructure
10
    from ..guild.member import GuildMember
11
    from ..user import User
12
    from ...utils.snowflake import Snowflake
13
14
15
@dataclass
16
class MessageContext:
17
    """
18
    Represents the context of a message interaction.
19
20
    :param id:
21
        The ID of the interaction.
22
23
    :param author:
24
        The user whom invoked the interaction.
25
26
    :param command:
27
        The local command object for the command to whom this context
28
        belongs.
29
30
    :param guild_id:
31
        The ID of the guild the interaction was invoked in.
32
        Can be None if it wasn't invoked in a guild.
33
34
    :param channel_id:
35
        The ID of the channel the interaction was invoked in.
36
        Can be None if it wasn't invoked in a channel.
37
    """
38
    id: Snowflake
0 ignored issues
show
introduced by
The variable Snowflake does not seem to be defined in case TYPE_CHECKING on line 8 is False. Are you sure this can never be the case?
Loading history...
39
    author: Union[GuildMember, User]
0 ignored issues
show
introduced by
The variable User does not seem to be defined in case TYPE_CHECKING on line 8 is False. Are you sure this can never be the case?
Loading history...
introduced by
The variable GuildMember does not seem to be defined in case TYPE_CHECKING on line 8 is False. Are you sure this can never be the case?
Loading history...
40
    command: ClientCommandStructure
0 ignored issues
show
introduced by
The variable ClientCommandStructure does not seem to be defined in case TYPE_CHECKING on line 8 is False. Are you sure this can never be the case?
Loading history...
41
42
    guild_id: Optional[Snowflake] = None
43
    channel_id: Optional[Snowflake] = None
44