Merge remote-tracking branch 'origin/stop-propagation-of-updates' into stop-propagation-of-updates

This commit is contained in:
JosXa 2018-02-27 03:48:22 +01:00
commit e973d10bfd
2 changed files with 8 additions and 9 deletions

View File

@ -153,8 +153,8 @@ Events module
.. automodule:: telethon.events .. automodule:: telethon.events
:members: :members:
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:

View File

@ -328,7 +328,7 @@ class TelegramClient(TelegramBareClient):
else: else:
raise RuntimeError( raise RuntimeError(
'{} consecutive sign-in attempts failed. Aborting' '{} consecutive sign-in attempts failed. Aborting'
.format(max_attempts) .format(max_attempts)
) )
if two_step_detected: if two_step_detected:
@ -616,13 +616,13 @@ class TelegramClient(TelegramBareClient):
return update.message return update.message
elif (isinstance(update, UpdateEditMessage) and elif (isinstance(update, UpdateEditMessage) and
not isinstance(request.peer, InputPeerChannel)): not isinstance(request.peer, InputPeerChannel)):
if request.id == update.message.id: if request.id == update.message.id:
return update.message return update.message
elif (isinstance(update, UpdateEditChannelMessage) and elif (isinstance(update, UpdateEditChannelMessage) and
utils.get_peer_id(request.peer) == utils.get_peer_id(request.peer) ==
utils.get_peer_id(update.message.to_id)): utils.get_peer_id(update.message.to_id)):
if request.id == update.message.id: if request.id == update.message.id:
return update.message return update.message
@ -931,7 +931,7 @@ class TelegramClient(TelegramBareClient):
m.message = getattr(m, 'message', None) m.message = getattr(m, 'message', None)
m.action = getattr(m, 'action', None) m.action = getattr(m, 'action', None)
m.sender = (None if not m.from_id else m.sender = (None if not m.from_id else
entities[utils.get_peer_id(m.from_id)]) entities[utils.get_peer_id(m.from_id)])
if getattr(m, 'fwd_from', None): if getattr(m, 'fwd_from', None):
m.fwd_from.sender = ( m.fwd_from.sender = (
@ -1873,7 +1873,6 @@ class TelegramClient(TelegramBareClient):
The event builder class or instance to be used, The event builder class or instance to be used,
for instance ``events.NewMessage``. for instance ``events.NewMessage``.
""" """
def decorator(f): def decorator(f):
self.add_event_handler(f, event) self.add_event_handler(f, event)
return f return f