From 26bcc78d14268736616a199326f64797b933e29e Mon Sep 17 00:00:00 2001 From: Lonami Exo Date: Sun, 5 Aug 2018 12:28:54 +0200 Subject: [PATCH] Fix Conversation.get_response --- telethon/tl/custom/conversation.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/telethon/tl/custom/conversation.py b/telethon/tl/custom/conversation.py index eb9f9b85..6856a68a 100644 --- a/telethon/tl/custom/conversation.py +++ b/telethon/tl/custom/conversation.py @@ -164,12 +164,12 @@ class Conversation(ChatGetter): # If there is no last-chosen ID, make sure to pick one *after* # the input message, since we don't want responses back in time if target_id not in indices: - for i, incoming in self._incoming: + for i, incoming in enumerate(self._incoming): if incoming.id > target_id: indices[target_id] = i break else: - indices[target_id] = 0 + indices[target_id] = len(self._incoming) # If there are enough responses saved return the next one last_idx = indices[target_id]