From 692073c856837e1e5e71f174cd4b866d12dd0f90 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Mon, 6 May 2019 17:09:44 +0200 Subject: [PATCH] Fix get_dialogs_count breaking in case of less than 200 dialogs --- pyrogram/client/methods/chats/get_dialogs_count.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pyrogram/client/methods/chats/get_dialogs_count.py b/pyrogram/client/methods/chats/get_dialogs_count.py index 1ba6895f..bf1754ee 100644 --- a/pyrogram/client/methods/chats/get_dialogs_count.py +++ b/pyrogram/client/methods/chats/get_dialogs_count.py @@ -48,4 +48,7 @@ class GetDialogsCount(BaseClient): ) ) - return r.count + if isinstance(r, types.messages.Dialogs): + return len(r.dialogs) + else: + return r.count