2
0
mirror of https://github.com/pyrogram/pyrogram synced 2025-08-29 13:27:47 +00:00

Fix set_administrator_title giving full permissions

This commit is contained in:
Dan 2020-02-01 16:01:41 +01:00
parent 9618bbc242
commit ce93f0ac64

View File

@ -80,6 +80,30 @@ class SetAdministratorTitle(BaseClient):
else: else:
raise ValueError("Custom titles can only be applied to owners or administrators of supergroups") 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( self.send(
functions.channels.EditAdmin( functions.channels.EditAdmin(
channel=chat_id, channel=chat_id,