mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-10 19:46:36 +03:00
Fix lack of support for anon channel restrictions (#4130)
This commit is contained in:
parent
2826c942c0
commit
1e63de9b68
|
@ -1116,8 +1116,8 @@ class ChatMethods:
|
|||
|
||||
user = await self.get_input_entity(user)
|
||||
ty = helpers._entity_type(user)
|
||||
if ty != helpers._EntityType.USER:
|
||||
raise ValueError('You must pass a user entity')
|
||||
if ty not in (helpers._EntityType.USER, helpers._EntityType.CHANNEL):
|
||||
raise ValueError('You must pass a user or channel entity')
|
||||
|
||||
if isinstance(user, types.InputPeerSelf):
|
||||
raise ValueError('You cannot restrict yourself')
|
||||
|
|
Loading…
Reference in New Issue
Block a user