mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-07-10 08:02:23 +03:00
Fix users not being set for some events.ChatAction and properties
This commit is contained in:
parent
1c8bf44713
commit
458d220af9
|
@ -525,15 +525,19 @@ class ChatAction(_EventBuilder):
|
||||||
elif isinstance(action, types.MessageActionChannelCreate):
|
elif isinstance(action, types.MessageActionChannelCreate):
|
||||||
event = ChatAction.Event(msg.to_id,
|
event = ChatAction.Event(msg.to_id,
|
||||||
created=True,
|
created=True,
|
||||||
|
users=msg.from_id,
|
||||||
new_title=action.title)
|
new_title=action.title)
|
||||||
elif isinstance(action, types.MessageActionChatEditTitle):
|
elif isinstance(action, types.MessageActionChatEditTitle):
|
||||||
event = ChatAction.Event(msg.to_id,
|
event = ChatAction.Event(msg.to_id,
|
||||||
|
users=msg.from_id,
|
||||||
new_title=action.title)
|
new_title=action.title)
|
||||||
elif isinstance(action, types.MessageActionChatEditPhoto):
|
elif isinstance(action, types.MessageActionChatEditPhoto):
|
||||||
event = ChatAction.Event(msg.to_id,
|
event = ChatAction.Event(msg.to_id,
|
||||||
|
users=msg.from_id,
|
||||||
new_photo=action.photo)
|
new_photo=action.photo)
|
||||||
elif isinstance(action, types.MessageActionChatDeletePhoto):
|
elif isinstance(action, types.MessageActionChatDeletePhoto):
|
||||||
event = ChatAction.Event(msg.to_id,
|
event = ChatAction.Event(msg.to_id,
|
||||||
|
users=msg.from_id,
|
||||||
new_photo=True)
|
new_photo=True)
|
||||||
else:
|
else:
|
||||||
return
|
return
|
||||||
|
@ -661,20 +665,16 @@ class ChatAction(_EventBuilder):
|
||||||
Might be ``None`` if the information can't be retrieved or
|
Might be ``None`` if the information can't be retrieved or
|
||||||
there is no user taking part.
|
there is no user taking part.
|
||||||
"""
|
"""
|
||||||
try:
|
if self.users:
|
||||||
return next(self.users)
|
return self._users[0]
|
||||||
except (StopIteration, TypeError):
|
|
||||||
return None
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def input_user(self):
|
def input_user(self):
|
||||||
"""
|
"""
|
||||||
Input version of the self.user property.
|
Input version of the self.user property.
|
||||||
"""
|
"""
|
||||||
try:
|
if self.input_users:
|
||||||
return next(self.input_users)
|
return self._input_users[0]
|
||||||
except (StopIteration, TypeError):
|
|
||||||
return None
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def users(self):
|
def users(self):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user