Pyrofork: Add can_{post,edit,delete}_stories parameter to ChatPrivileges and promote_chat_member

This commit is contained in:
wulan17 2023-12-30 18:54:18 +07:00
parent b8ccff40e2
commit 3fee62dd1d
No known key found for this signature in database
GPG key ID: 318CD6CD3A6AC0A5
2 changed files with 24 additions and 0 deletions

View file

@ -94,6 +94,9 @@ class PromoteChatMember:
add_admins=privileges.can_promote_members,
manage_call=privileges.can_manage_video_chats,
manage_topics=privileges.can_manage_topics,
post_stories=privileges.can_post_stories,
edit_stories=privileges.can_edit_stories,
delete_stories=privileges.can_delete_stories,
other=privileges.can_manage_chat
),
rank=rank or ""

View file

@ -67,6 +67,18 @@ class ChatPrivileges(Object):
supergroups only.
True, if the user is allowed to create, rename, close, and reopen forum topics.
can_post_stories (``bool``, *optional*):
Channels only.
True, if the administrator can post stories in the channel.
can_edit_stories (``bool``, *optional*):
Channels only.
True, if the administrator can edit stories in the channel.
can_delete_stories (``bool``, *optional*):
Channels only.
True, if the administrator can delete stories in the channel.
is_anonymous (``bool``, *optional*):
True, if the user's presence in the chat is hidden.
"""
@ -85,6 +97,9 @@ class ChatPrivileges(Object):
can_invite_users: bool = False,
can_pin_messages: bool = False, # Groups and supergroups only
can_manage_topics: bool = False, # supergroups only.
can_post_stories: bool = False, # Channels only
can_edit_stories: bool = False, # Channels only
can_delete_stories: bool = False, # Channels only
is_anonymous: bool = False
):
super().__init__(None)
@ -100,6 +115,9 @@ class ChatPrivileges(Object):
self.can_invite_users: bool = can_invite_users
self.can_pin_messages: bool = can_pin_messages
self.can_manage_topics: bool = can_manage_topics
self.can_post_stories: bool = can_post_stories
self.can_edit_stories: bool = can_edit_stories
self.can_delete_stories: bool = can_delete_stories
self.is_anonymous: bool = is_anonymous
@staticmethod
@ -116,5 +134,8 @@ class ChatPrivileges(Object):
can_invite_users=admin_rights.invite_users,
can_pin_messages=admin_rights.pin_messages,
can_manage_topics=admin_rights.manage_topics,
can_post_stories=admin_rights.post_stories,
can_edit_stories=admin_rights.edit_stories,
can_delete_stories=admin_rights.delete_stories,
is_anonymous=admin_rights.anonymous
)