get_story_views()

Client.get_story_views()

Obtain the list of users that have viewed a specific story we posted.

Usable by Users Bots
Parameters:
  • chat_id (``int`` | ``str``) – Unique identifier (int) or username (str) of the target chat. For your personal cloud (Saved Messages) you can simply use “me” or “self”. For a contact that exists in your Telegram address book you can use his phone number (str).

  • story_id (``int``) – Pass a story identifier to get the story views.

  • offset (``str``, *optional*) – Offset of the results to be returned.

  • limit (``int``, *optional*) – Maximum number of views to return.

  • contacts_only (``bool``, *optional*) – Only Get views made by your contacts, Defaults to False.

  • reactions_first (``bool``, *optional*) – If True, return reactions first, Defaults to False.

  • forwards_first (``bool``, *optional*) – If True, return forwards first, Defaults to False.

  • query (``str``, *optional*) – Search for specific users.

Returns:

``Generator`` (A generator yielding StoryView objects.)

Example

# Get views
async for view in app.get_story_views(chat_id, story_id):
    print(view)