edit_story_privacy()¶
- Client.edit_story_privacy()¶
Edit the privacy of 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”. For a contact that exists in your Telegram address book you can use his phone number (str).
story_id (``int``) – Story identifier in the chat specified in chat_id.
privacy (:obj:`~pyrogram.enums.StoriesPrivacyRules`, *optional*) – Story privacy. Defaults to
PUBLIC.allowed_users (List of ``int`` | ``str``, *optional*) – List of user_id or chat_id of chat users who are allowed to view stories. Note: chat_id available only with
SELECTED_USERS. Works withCLOSE_FRIENDSandSELECTED_USERSonlydisallowed_users (List of ``int`` | ``str``, *optional*) – List of user_id whos disallow to view the stories. Note: Works with
PUBLICandCONTACTSonly
- Returns:¶
:obj:`~pyrogram.types.Story` (On success, the edited story is returned.)
Example
# Edit story privacy to public await app.edit_story_privacy(chat_id, story_id, enums.StoriesPrivacyRules.PUBLIC) # Edit the privacy of the story to allow selected users to view the story await app.edit_story_privacy( chat_id, story_id, enums.StoriesPrivacyRules.SELECTED_USERS, allowed_users=[123, 456] )