Skip to content

Commit

Permalink
Handle UpdateMessagePoll in _get_response_message (LonamiWebs#1355)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lonami committed Dec 26, 2019
1 parent 86bb4b4 commit 29ff370
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions telethon/client/messageparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 150,19 @@ def _get_response_message(self: 'TelegramClient', request, result, input_chat):
update.message._finish_init(self, entities, input_chat)
sched_to_message[update.message.id] = update.message

elif isinstance(update, types.UpdateMessagePoll):
if request.media.poll.id == update.poll_id:
m = types.Message(
id=request.id,
to_id=utils.get_peer(request.peer),
media=types.MessageMediaPoll(
poll=update.poll,
results=update.results
)
)
m._finish_init(self, entities, input_chat)
return m

if request is None:
return id_to_message

Expand Down

0 comments on commit 29ff370

Please sign in to comment.