From 7e38a2c0b114f766a6baafd4a872d6bb896f5ee0 Mon Sep 17 00:00:00 2001 From: Soheab_ <33902984+Soheab@users.noreply.github.com> Date: Sun, 22 Jun 2025 00:33:17 +0200 Subject: [PATCH] Update docstring --- discord/abc.py | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/discord/abc.py b/discord/abc.py index 1486228c3..281c6c75d 100644 --- a/discord/abc.py +++ b/discord/abc.py @@ -1719,8 +1719,8 @@ class Messageable: ) -> AsyncIterator[Message]: """Retrieves an :term:`asynchronous iterator` of the pinned messages in the channel. - You must have :attr:`~discord.Permissions.view_channel` and - :attr:`~discord.Permissions.read_message_history` to get these. + You must have the following permissions to get these: + :attr:`~discord.Permissions.view_channel`, :attr:`~discord.Permissions.read_message_history`. .. versionchanged:: 2.6 Due to a change in Discord's API, this now returns a paginated iterator instead of a list. @@ -1733,24 +1733,24 @@ class Messageable: Parameters ----------- - before: Optional[:class:`datetime.datetime`] + limit: Optional[int] + The number of pinned messages to retrieve. If ``None``, it retrieves + every pinned message in the channel. Note, however, that this would + make it a slow operation. + Defaults to ``50``. + + .. versionadded:: 2.6 + before: Union[:class:`datetime.datetime`, :class:`.abc.Snowflake`] Retrieve pinned messages before this time or snowflake. If a datetime is provided, it is recommended to use a UTC aware datetime. If the datetime is naive, it is assumed to be local time. .. versionadded:: 2.6 - after: Optional[:class:`datetime.datetime`] + after: Union[:class:`datetime.datetime`, :class:`.abc.Snowflake`] Retrieve pinned messages after this time or snowflake. If a datetime is provided, it is recommended to use a UTC aware datetime. If the datetime is naive, it is assumed to be local time. - .. versionadded:: 2.6 - limit: Optional[int] - The number of pinned messages to retrieve. If ``None``, it retrieves - every pinned message in the channel. Note, however, that this would - make it a slow operation. - Defaults to ``50``. - .. versionadded:: 2.6 Raises @@ -1760,7 +1760,10 @@ class Messageable: ~discord.HTTPException Retrieving the pinned messages failed. TypeError - The ``before`` parameter was not an aware :class:`datetime.datetime` object. + + - The ``before`` parameter was not an aware :class:`datetime.datetime` object. + - The ``after`` parameter was not an aware :class:`datetime.datetime` object. + - The ``before`` and ``after`` parameters were both set. Returns --------