mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-22 09:26:37 +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)
|
user = await self.get_input_entity(user)
|
||||||
ty = helpers._entity_type(user)
|
ty = helpers._entity_type(user)
|
||||||
if ty != helpers._EntityType.USER:
|
if ty not in (helpers._EntityType.USER, helpers._EntityType.CHANNEL):
|
||||||
raise ValueError('You must pass a user entity')
|
raise ValueError('You must pass a user or channel entity')
|
||||||
|
|
||||||
if isinstance(user, types.InputPeerSelf):
|
if isinstance(user, types.InputPeerSelf):
|
||||||
raise ValueError('You cannot restrict yourself')
|
raise ValueError('You cannot restrict yourself')
|
||||||
|
|
Loading…
Reference in New Issue
Block a user