From 5dff2fe6044bffca1c5609a1d1980a21d0f7bec1 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Sat, 12 May 2018 15:36:47 +0200 Subject: [PATCH] Fix get_history in chats with less than 100 messages --- pyrogram/client/methods/messages/get_history.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyrogram/client/methods/messages/get_history.py b/pyrogram/client/methods/messages/get_history.py index cc724458..4089dde9 100644 --- a/pyrogram/client/methods/messages/get_history.py +++ b/pyrogram/client/methods/messages/get_history.py @@ -106,6 +106,6 @@ class GetHistory(BaseClient): messages[i].reply_to_message = reply_to_messages[r.messages[i].reply_to_msg_id] return pyrogram.Messages( - total_count=r.count, + total_count=getattr(r, "count", len(r.messages)), messages=messages )