From 72dd36bc17b8f9717d91f47e4dabc988d9f6b8d0 Mon Sep 17 00:00:00 2001 From: Tanner Collin Date: Sun, 29 Sep 2019 01:19:44 -0600 Subject: [PATCH] Allow edit_admin on yourself (#1285) --- telethon/client/chats.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/telethon/client/chats.py b/telethon/client/chats.py index faa15e77..b86b4fa5 100644 --- a/telethon/client/chats.py +++ b/telethon/client/chats.py @@ -864,10 +864,7 @@ class ChatMethods: """ entity = await self.get_input_entity(entity) user = await self.get_input_entity(user) - if isinstance(user, types.InputPeerSelf): - raise ValueError('You cannot admin yourself') - - if not isinstance(user, types.InputPeerUser): + if not isinstance(user, (types.InputPeerUser, types.InputPeerSelf)): raise ValueError('You must pass a user entity') perm_names = (