Skip to content

Commit

Permalink
Fix add_admins property of custom.ParticipantPermissions (#3132)
Browse files Browse the repository at this point in the history
Closes #3131.
  • Loading branch information
aszubarev committed Aug 15, 2021
1 parent e546ae2 commit 45ed665
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion telethon/tl/custom/participantpermissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,12 @@ def add_admins(self):
Whether the administrator can add new administrators with the same or
less permissions than them.
"""
if not self.is_admin or (self.is_chat and not self.is_creator):
if not self.is_admin:
return False

if self.is_chat:
return self.is_creator

return self.participant.admin_rights.add_admins

ban_users = property(**_admin_prop('ban_users', """
Expand Down

0 comments on commit 45ed665

Please sign in to comment.