toggle_forum_topic_is_pinned()

Client.toggle_forum_topic_is_pinned()

Changes the pinned state of a forum topic; requires can_manage_topics right in the supergroup. There can be up to pinned_forum_topic_count_max pinned forum topics.

Usable by Users Bots
Parameters:
  • chat_id (``int`` | ``str``) – Unique identifier (int) or username (str) of the target chat.

  • message_thread_id (``int``) – Unique identifier for the target message thread of the forum topic.

  • is_pinned (``bool``) – Pass True to pin the topic; pass False to unpin it.

Returns:

``bool`` (On success, True is returned.)

Raises:

RPCError –

Example

await app.toggle_forum_topic_is_pinned(chat_id, topic_id, True)