mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-08-02 11:10:18 +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)
|
||||
user = await self.get_input_entity(user)
|
||||
if isinstance(user, types.InputPeerSelf):
|
||||
raise ValueError('You cannot admin yourself')
|
||||
|
||||
if not isinstance(user, types.InputPeerUser):
|
||||
raise ValueError('You must pass a user entity')
|
||||
|
||||
|
@ -996,6 +999,9 @@ class ChatMethods:
|
|||
))
|
||||
|
||||
user = await self.get_input_entity(user)
|
||||
if isinstance(user, types.InputPeerSelf):
|
||||
raise ValueError("You cannot restrict yourself")
|
||||
|
||||
if not isinstance(user, types.InputPeerUser):
|
||||
raise ValueError('You must pass a user entity')
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user