mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2026-01-08 07:54:52 +00:00
Pyrofork: Add can_{post,edit,delete}_stories parameter to ChatPrivileges and promote_chat_member
This commit is contained in:
parent
b8ccff40e2
commit
3fee62dd1d
2 changed files with 24 additions and 0 deletions
|
|
@ -94,6 +94,9 @@ class PromoteChatMember:
|
||||||
add_admins=privileges.can_promote_members,
|
add_admins=privileges.can_promote_members,
|
||||||
manage_call=privileges.can_manage_video_chats,
|
manage_call=privileges.can_manage_video_chats,
|
||||||
manage_topics=privileges.can_manage_topics,
|
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
|
other=privileges.can_manage_chat
|
||||||
),
|
),
|
||||||
rank=rank or ""
|
rank=rank or ""
|
||||||
|
|
|
||||||
|
|
@ -67,6 +67,18 @@ class ChatPrivileges(Object):
|
||||||
supergroups only.
|
supergroups only.
|
||||||
True, if the user is allowed to create, rename, close, and reopen forum topics.
|
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*):
|
is_anonymous (``bool``, *optional*):
|
||||||
True, if the user's presence in the chat is hidden.
|
True, if the user's presence in the chat is hidden.
|
||||||
"""
|
"""
|
||||||
|
|
@ -85,6 +97,9 @@ class ChatPrivileges(Object):
|
||||||
can_invite_users: bool = False,
|
can_invite_users: bool = False,
|
||||||
can_pin_messages: bool = False, # Groups and supergroups only
|
can_pin_messages: bool = False, # Groups and supergroups only
|
||||||
can_manage_topics: bool = False, # 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
|
is_anonymous: bool = False
|
||||||
):
|
):
|
||||||
super().__init__(None)
|
super().__init__(None)
|
||||||
|
|
@ -100,6 +115,9 @@ class ChatPrivileges(Object):
|
||||||
self.can_invite_users: bool = can_invite_users
|
self.can_invite_users: bool = can_invite_users
|
||||||
self.can_pin_messages: bool = can_pin_messages
|
self.can_pin_messages: bool = can_pin_messages
|
||||||
self.can_manage_topics: bool = can_manage_topics
|
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
|
self.is_anonymous: bool = is_anonymous
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
|
@ -116,5 +134,8 @@ class ChatPrivileges(Object):
|
||||||
can_invite_users=admin_rights.invite_users,
|
can_invite_users=admin_rights.invite_users,
|
||||||
can_pin_messages=admin_rights.pin_messages,
|
can_pin_messages=admin_rights.pin_messages,
|
||||||
can_manage_topics=admin_rights.manage_topics,
|
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
|
is_anonymous=admin_rights.anonymous
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue