get_stories()#

Client.get_stories()#

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

Usable by Users Bots
Parameters:
  • chat_id (int | str) – Unique identifier (int) or username (str) of the target user. For your personal story 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_ids (int | Iterable of int) – Pass a single story identifier or an iterable of story ids (as integers) to get the content of the story themselves.

Returns:

Story | List of 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(chat_id, [1, 2, 3])

for story in stories:
    print(story)