Passed
Pull Request — main (#163)
by
unknown
01:29
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.snowflake import Snowflake
8
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 70)'
Loading history...
9
from ...utils.types import MISSING, APINullable
10
11
12
@dataclass
13
class ChannelPinsUpdateEvent(APIObject):
14
    """
15
    Sent when a message is pinned or unpinned in a text channel.
16
    This is not sent when a pinned message is deleted.
17
18
    :param guild_id:
19
        the id of the guild
20
21
    :param channel_id:
22
        the id of the channel
23
24
    :param last_pin_timestamp:
25
        the time at which the most recent pinned message was pinned
26
    """
27
    channel_id: Snowflake
28
29
    guild_id: APINullable[Snowflake] = MISSING
30
    last_pin_timestamp: APINullable[Timestamp] = MISSING
31
32
33
    def __post_init__(self):
34
        self.last_pin_timestamp = convert(
0 ignored issues
show
Comprehensibility Best Practice introduced by
Undefined variable 'convert'
Loading history...
35
            self.last_pin_timestamp, Timestamp.parse, Timestamp
36
    )
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation.
Loading history...
37