mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-08-03 11:40:11 +03:00
Added notes to InputPeerSelf
This commit is contained in:
parent
97cc4aeb06
commit
ab3e0e2769
|
@ -847,6 +847,9 @@ class ChatMethods:
|
||||||
"""
|
"""
|
||||||
entity = await self.get_input_entity(entity)
|
entity = await self.get_input_entity(entity)
|
||||||
user = await self.get_input_entity(user)
|
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):
|
||||||
raise ValueError('You must pass a user entity')
|
raise ValueError('You must pass a user entity')
|
||||||
|
|
||||||
|
@ -996,6 +999,9 @@ class ChatMethods:
|
||||||
))
|
))
|
||||||
|
|
||||||
user = await self.get_input_entity(user)
|
user = await self.get_input_entity(user)
|
||||||
|
if isinstance(user, types.InputPeerSelf):
|
||||||
|
raise ValueError("You cannot restrict yourself")
|
||||||
|
|
||||||
if not isinstance(user, types.InputPeerUser):
|
if not isinstance(user, types.InputPeerUser):
|
||||||
raise ValueError('You must pass a user entity')
|
raise ValueError('You must pass a user entity')
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user