mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2025-12-29 12:04:51 +00:00
pyrofork: Add can_manage_direct_messages field to ChatPrivileges
Signed-off-by: wulan17 <wulan17@komodos.id>
This commit is contained in:
parent
7b48fbf5b8
commit
a3fdc44a56
1 changed files with 8 additions and 2 deletions
|
|
@ -81,6 +81,9 @@ class ChatPrivileges(Object):
|
||||||
|
|
||||||
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.
|
||||||
|
|
||||||
|
can_manage_direct_messages (``bool``, *optional*):
|
||||||
|
True, if the administrator can manage direct messages sent to the chat.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
|
|
@ -100,7 +103,8 @@ class ChatPrivileges(Object):
|
||||||
can_post_stories: bool = False, # Channels only
|
can_post_stories: bool = False, # Channels only
|
||||||
can_edit_stories: bool = False, # Channels only
|
can_edit_stories: bool = False, # Channels only
|
||||||
can_delete_stories: bool = False, # Channels only
|
can_delete_stories: bool = False, # Channels only
|
||||||
is_anonymous: bool = False
|
is_anonymous: bool = False,
|
||||||
|
can_manage_direct_messages: bool = False
|
||||||
):
|
):
|
||||||
super().__init__(None)
|
super().__init__(None)
|
||||||
|
|
||||||
|
|
@ -119,6 +123,7 @@ class ChatPrivileges(Object):
|
||||||
self.can_edit_stories: bool = can_edit_stories
|
self.can_edit_stories: bool = can_edit_stories
|
||||||
self.can_delete_stories: bool = can_delete_stories
|
self.can_delete_stories: bool = can_delete_stories
|
||||||
self.is_anonymous: bool = is_anonymous
|
self.is_anonymous: bool = is_anonymous
|
||||||
|
self.can_manage_direct_messages: bool = can_manage_direct_messages
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _parse(admin_rights: "raw.base.ChatAdminRights") -> "ChatPrivileges":
|
def _parse(admin_rights: "raw.base.ChatAdminRights") -> "ChatPrivileges":
|
||||||
|
|
@ -137,5 +142,6 @@ class ChatPrivileges(Object):
|
||||||
can_post_stories=admin_rights.post_stories,
|
can_post_stories=admin_rights.post_stories,
|
||||||
can_edit_stories=admin_rights.edit_stories,
|
can_edit_stories=admin_rights.edit_stories,
|
||||||
can_delete_stories=admin_rights.delete_stories,
|
can_delete_stories=admin_rights.delete_stories,
|
||||||
is_anonymous=admin_rights.anonymous
|
is_anonymous=admin_rights.anonymous,
|
||||||
|
can_manage_direct_messages=admin_rights.manage_direct_messages
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue