get_forum_topics()

Client.get_forum_topics(chat_id: int | str, limit: int = 0, query: str = '', offset_date: int = 0, offset_message_id: int = 0, offset_message_thread_id: int = 0) AsyncGenerator[ForumTopic, None]

Get one or more topic from a chat.

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

  • limit (int, optional) – Limits the number of topics to be retrieved. By default, no limit is applied and all topics are returned.

Returns:

Generator – A generator yielding ForumTopic objects.

Example

# Iterate through all topics
async for topic in app.get_forum_topics(chat_id):
    print(topic)