Update telegram_client.py

Revert layout changes
This commit is contained in:
Joscha Götzer 2018-02-20 15:20:23 +01:00 committed by GitHub
parent 12838bc711
commit 9e5128547a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -324,7 +324,7 @@ class TelegramClient(TelegramBareClient):
else:
raise RuntimeError(
'{} consecutive sign-in attempts failed. Aborting'
.format(max_attempts)
.format(max_attempts)
)
if two_step_detected:
@ -591,13 +591,13 @@ class TelegramClient(TelegramBareClient):
return update.message
elif (isinstance(update, UpdateEditMessage) and
not isinstance(request.peer, InputPeerChannel)):
not isinstance(request.peer, InputPeerChannel)):
if request.id == update.message.id:
return update.message
elif (isinstance(update, UpdateEditChannelMessage) and
utils.get_peer_id(request.peer) ==
utils.get_peer_id(update.message.to_id)):
utils.get_peer_id(request.peer) ==
utils.get_peer_id(update.message.to_id)):
if request.id == update.message.id:
return update.message
@ -886,7 +886,7 @@ class TelegramClient(TelegramBareClient):
m.message = getattr(m, 'message', None)
m.action = getattr(m, 'action', None)
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):
m.fwd_from.sender = (
@ -1768,7 +1768,6 @@ class TelegramClient(TelegramBareClient):
The event builder class or instance to be used,
for instance ``events.NewMessage``.
"""
def decorator(f):
self.add_event_handler(f, event)
return f