Passed
Pull Request — main (#174)
by
unknown
01:46
created

ChannelPinsUpdateEvent.__post_init__()   A

Complexity

Conditions 1

Size

Total Lines 3
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nop 1
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
6
from ...utils.api_object import APIObject
0 ignored issues
show
Bug introduced by
The name api_object does not seem to exist in module pincer.utils.
Loading history...
introduced by
Cannot import 'utils.api_object' due to syntax error 'invalid syntax (<unknown>, line 80)'
Loading history...
7
from ...utils.conversion import convert
8
from ...utils.snowflake import Snowflake
9
from ...utils.timestamp import Timestamp
0 ignored issues
show
Bug introduced by
The name timestamp does not seem to exist in module pincer.utils.
Loading history...
introduced by
Cannot import 'utils.timestamp' due to syntax error 'invalid syntax (<unknown>, line 74)'
Loading history...
10
from ...utils.types import MISSING, APINullable
11
12
13
@dataclass
14
class ChannelPinsUpdateEvent(APIObject):
15
    """
16
    Sent when a message is pinned or unpinned in a text channel.
17
    This is not sent when a pinned message is deleted.
18
19
    :param guild_id:
20
        the id of the guild
21
22
    :param channel_id:
23
        the id of the channel
24
25
    :param last_pin_timestamp:
26
        the time at which the most recent pinned message was pinned
27
    """
28
    channel_id: Snowflake
29
30
    guild_id: APINullable[Snowflake] = MISSING
31
    last_pin_timestamp: APINullable[Timestamp] = MISSING
32
33
34
    def __post_init__(self):
35
        self.last_pin_timestamp = convert(
36
            self.last_pin_timestamp, Timestamp.parse, Timestamp
37
    )
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation.
Loading history...
38