edit_story()#
- Client.edit_story()#
Changes content, privacy settings and caption of a story.
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”.story_id (
int
) – Unique identifier of the story to edit.content (
InputStoryContent
, optional) – Content of the story.caption (
str
, optional) – Caption of the story, 0-2048 characters after entities parsing.parse_mode (
ParseMode
, optional) – By default, texts are parsed using both Markdown and HTML styles. You can combine both syntaxes together.caption_entities (List of
MessageEntity
) – List of special entities that appear in the caption, which can be specified instead of parse_mode.areas (List of
StoryArea
, optional) – List of of clickable areas to be shown on the story.privacy_settings (
StoryPrivacySettings
, optional) – The privacy settings for the story; ignored for stories sent to supergroup and channel chats. Defaults toStoryPrivacySettingsEveryone
.progress (
Callable
, optional) – Pass a callback function to view the file transmission progress. The function must take (current, total) as positional arguments (look at Other Parameters below for a detailed description) and will be called back each time a new file chunk has been successfully transmitted.progress_args (
tuple
, optional) – Extra custom arguments for the progress callback function. You can pass anything you need to be available in the progress callback scope; for example, a Message object or a Client instance in order to edit the message with the updated progress status.
- Returns:
Story
a single story is returned.
Example
# Post story to your profile await app.edit_story("me", 7, "story.png", caption='My new story!') # Post story to channel await app.send_story(123456, 3, "story.png", caption='My new story!')
- Raises:
ValueError – In case of invalid arguments.
RPCError – In case of Telegram RPCError.