From ce93f0ac64a7cfc630dee5310104c8a9ee72b41e Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Sat, 1 Feb 2020 16:01:41 +0100 Subject: [PATCH] Fix set_administrator_title giving full permissions --- .../methods/chats/set_administrator_title.py | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/pyrogram/client/methods/chats/set_administrator_title.py b/pyrogram/client/methods/chats/set_administrator_title.py index 23b06a57..fb2265c5 100644 --- a/pyrogram/client/methods/chats/set_administrator_title.py +++ b/pyrogram/client/methods/chats/set_administrator_title.py @@ -80,6 +80,30 @@ class SetAdministratorTitle(BaseClient): else: raise ValueError("Custom titles can only be applied to owners or administrators of supergroups") + if not admin_rights.change_info: + admin_rights.change_info = None + + if not admin_rights.post_messages: + admin_rights.post_messages = None + + if not admin_rights.edit_messages: + admin_rights.edit_messages = None + + if not admin_rights.delete_messages: + admin_rights.delete_messages = None + + if not admin_rights.ban_users: + admin_rights.ban_users = None + + if not admin_rights.invite_users: + admin_rights.invite_users = None + + if not admin_rights.pin_messages: + admin_rights.pin_messages = None + + if not admin_rights.add_admins: + admin_rights.add_admins = None + self.send( functions.channels.EditAdmin( channel=chat_id,