From 45ed6658fe6829f0efe6196dc91adb797e802daa Mon Sep 17 00:00:00 2001 From: ZubAnt Date: Sun, 15 Aug 2021 09:01:25 +0300 Subject: [PATCH] Fix add_admins property of custom.ParticipantPermissions (#3132) Closes #3131. --- telethon/tl/custom/participantpermissions.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/telethon/tl/custom/participantpermissions.py b/telethon/tl/custom/participantpermissions.py index c59a05ed..d3719778 100644 --- a/telethon/tl/custom/participantpermissions.py +++ b/telethon/tl/custom/participantpermissions.py @@ -92,9 +92,12 @@ class ParticipantPermissions: 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', """