From a3fdc44a56db0f4834263063a3c1ba96d0ed505a Mon Sep 17 00:00:00 2001 From: wulan17 Date: Wed, 10 Dec 2025 22:48:21 +0700 Subject: [PATCH] pyrofork: Add can_manage_direct_messages field to ChatPrivileges Signed-off-by: wulan17 --- pyrogram/types/user_and_chats/chat_privileges.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pyrogram/types/user_and_chats/chat_privileges.py b/pyrogram/types/user_and_chats/chat_privileges.py index 0e8be3b1..1179aa92 100644 --- a/pyrogram/types/user_and_chats/chat_privileges.py +++ b/pyrogram/types/user_and_chats/chat_privileges.py @@ -81,6 +81,9 @@ class ChatPrivileges(Object): is_anonymous (``bool``, *optional*): 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__( @@ -100,7 +103,8 @@ class ChatPrivileges(Object): 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, + can_manage_direct_messages: bool = False ): super().__init__(None) @@ -119,6 +123,7 @@ class ChatPrivileges(Object): self.can_edit_stories: bool = can_edit_stories self.can_delete_stories: bool = can_delete_stories self.is_anonymous: bool = is_anonymous + self.can_manage_direct_messages: bool = can_manage_direct_messages @staticmethod def _parse(admin_rights: "raw.base.ChatAdminRights") -> "ChatPrivileges": @@ -137,5 +142,6 @@ class ChatPrivileges(Object): 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, + can_manage_direct_messages=admin_rights.manage_direct_messages )