mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-08-08 21:10:29 +00:00
Add new is_bot method to check if the logged-in user is a bot
This commit is contained in:
@@ -351,6 +351,7 @@ class AuthMethods(MessageParseMethods, UserMethods):
|
||||
|
||||
Returns the input user parameter.
|
||||
"""
|
||||
self._bot = bool(user.bot)
|
||||
self._self_input_peer = utils.get_input_peer(user, allow_self=False)
|
||||
self._authorized = True
|
||||
|
||||
@@ -413,6 +414,7 @@ class AuthMethods(MessageParseMethods, UserMethods):
|
||||
except errors.RPCError:
|
||||
return False
|
||||
|
||||
self._bot = None
|
||||
self._self_input_peer = None
|
||||
self._authorized = False
|
||||
self._state = types.updates.State(0, 0, datetime.datetime.now(), 0, 0)
|
||||
|
Reference in New Issue
Block a user