get_stories()

Client.get_stories()

Get one or more stories from a chat by using stories identifiers.

Usable by Users Bots
Parameters:
  • story_poster_chat_id (``int`` | ``str``) – Identifier of the chat that posted the story.

  • story_ids (``int`` | Iterable of ``int``, *optional*) – Pass a single story identifier or an iterable of story ids (as integers) to get the content of the story themselves.

Returns:

  • :obj:`~pyrogram.types.Story` | List of :obj:`~pyrogram.types.Story` (In case *story_ids was not*)

  • a list, a single story is returned, otherwise a list of stories is returned.

Example

# Get stories by id
stories = await app.get_stories(
    story_poster_chat_id,
    [1, 2, 3]
)

for story in stories:
    print(story)