diff --git a/pyrogram/client/methods/chats/pin_chat_message.py b/pyrogram/client/methods/chats/pin_chat_message.py index 5f7db61e..e9bc533e 100644 --- a/pyrogram/client/methods/chats/pin_chat_message.py +++ b/pyrogram/client/methods/chats/pin_chat_message.py @@ -22,7 +22,29 @@ from ...ext import BaseClient class PinChatMessage(BaseClient): def pin_chat_message(self, chat_id: int or str, message_id: int, disable_notification: bool = None): - # TODO: Docstrings + """Use this method to pin a message in a supergroup or a channel. + You must be an administrator in the chat for this to work and must have the "can_pin_messages" admin right in + the supergroup or "can_edit_messages" admin right in the channel. + + Args: + chat_id (``int`` | ``str``): + Unique identifier (int) or username (str) of the target chat. + For a private channel/supergroup you can use its *t.me/joinchat/* link. + + message_id (``int``): + Identifier of a message to pin. + + disable_notification (``bool``): + Pass True, if it is not necessary to send a notification to all chat members about the new pinned + message. Notifications are always disabled in channels. + + Returns: + True on success. + + Raises: + :class:`Error ` + ``ValueError``: If a chat_id doesn't belong to a supergroup or a channel. + """ peer = self.resolve_peer(chat_id) if isinstance(peer, types.InputPeerChannel):