mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-10 19:46:36 +03:00
Add input user versions to events.ChatAction
This commit is contained in:
parent
c40a3ca77c
commit
1c8bf44713
|
@ -607,6 +607,7 @@ class ChatAction(_EventBuilder):
|
|||
self.created = bool(created)
|
||||
self._user_peers = users if isinstance(users, list) else [users]
|
||||
self._users = None
|
||||
self._input_users = None
|
||||
self.new_title = new_title
|
||||
|
||||
@property
|
||||
|
@ -665,6 +666,16 @@ class ChatAction(_EventBuilder):
|
|||
except (StopIteration, TypeError):
|
||||
return None
|
||||
|
||||
@property
|
||||
def input_user(self):
|
||||
"""
|
||||
Input version of the self.user property.
|
||||
"""
|
||||
try:
|
||||
return next(self.input_users)
|
||||
except (StopIteration, TypeError):
|
||||
return None
|
||||
|
||||
@property
|
||||
def users(self):
|
||||
"""
|
||||
|
@ -681,6 +692,22 @@ class ChatAction(_EventBuilder):
|
|||
|
||||
return self._users
|
||||
|
||||
@property
|
||||
def input_users(self):
|
||||
"""
|
||||
Input version of the self.users property.
|
||||
"""
|
||||
if self._input_users is None and self._user_peers:
|
||||
self._input_users = []
|
||||
for peer in self._user_peers:
|
||||
try:
|
||||
self._input_users.append(self._client.get_input_entity(
|
||||
peer
|
||||
))
|
||||
except (TypeError, ValueError):
|
||||
pass
|
||||
return self._input_users
|
||||
|
||||
|
||||
class UserUpdate(_EventBuilder):
|
||||
"""
|
||||
|
|
Loading…
Reference in New Issue
Block a user