mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-04-21 17:42:01 +03:00
Add support for anon channel restrictions
This commit is contained in:
parent
65407fc899
commit
bc0f8331d3
|
@ -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