| Total Complexity | 1 |
| Total Lines | 37 |
| 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 | |||
| 6 | from ...utils.api_object import APIObject |
||
| 7 | from ...utils.conversion import convert |
||
| 8 | from ...utils.snowflake import Snowflake |
||
| 9 | from ...utils.timestamp import Timestamp |
||
| 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 | ) |
||
| 38 |