get_top_chats()

Client.get_top_chats()

Returns a list of frequently used chats.

Usable by Users Bots

Parameters:
  • category (TopChatCategory) – Category of chats to be returned.

  • limit (int, optional) – The maximum number of chats to be returned. By default, no limit is applied and all chats are returned.

Returns:

Generator – A generator yielding Chat objects.

Example

async for chat in app.get_top_chats(enums.TopChatCategory.USERS):
    print(chat.full_name)