peyk.platforms.telegram.methods.pin_chat_message¶
- async peyk.platforms.telegram.methods.pin_chat_message(self, chat_id: int | str, message_id: int, *, disable_notification: bool | None = None) bool[source]¶
Use this method to add a message to the list of pinned messages in a chat. In private chats and channel direct messages chats, all non-service messages can be pinned. Conversely, the bot must be an administrator with the ‘can_pin_messages’ right or the ‘can_edit_messages’ right to pin messages in groups and channels respectively. Returns True on success.
- Parameters:
chat_id – Unique identifier for the target chat or username of the target channel in the format @username
message_id – Identifier of a message to pin
disable_notification – 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 and private chats.
- Returns:
Result returned by Telegram on successful execution.
- Return type:
bool