for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
# Copyright Pincer 2021-Present
# Full MIT License can be found in `LICENSE` at the project root.
from dataclasses import dataclass
from ...utils.api_object import APIObject
api_object
pincer.utils
from ...utils.conversion import convert
from ...utils.snowflake import Snowflake
from ...utils.timestamp import Timestamp
timestamp
from ...utils.types import MISSING, APINullable
@dataclass
class ChannelPinsUpdateEvent(APIObject):
"""
Sent when a message is pinned or unpinned in a text channel.
This is not sent when a pinned message is deleted.
:param guild_id:
the id of the guild
:param channel_id:
the id of the channel
:param last_pin_timestamp:
the time at which the most recent pinned message was pinned
channel_id: Snowflake
guild_id: APINullable[Snowflake] = MISSING
last_pin_timestamp: APINullable[Timestamp] = MISSING
def __post_init__(self):
self.last_pin_timestamp = convert(
self.last_pin_timestamp, Timestamp.parse, Timestamp
)