From 5f47c8c4990317352ab89f80af60909b8928b17a Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Mon, 25 Apr 2022 16:52:04 +0200 Subject: [PATCH] Fix some examples --- pyrogram/methods/chats/get_chat_members.py | 12 ++++++------ pyrogram/methods/messages/read_chat_history.py | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/pyrogram/methods/chats/get_chat_members.py b/pyrogram/methods/chats/get_chat_members.py index 65688a3d..3e11872c 100644 --- a/pyrogram/methods/chats/get_chat_members.py +++ b/pyrogram/methods/chats/get_chat_members.py @@ -101,14 +101,14 @@ class GetChatMembers: print(member) # Get administrators - administrators = list(await app.get_chat_members( - chat_id, - filter=enums.ChatMembersFilter.ADMINISTRATORS)) + administrators = [] + async for m in app.get_chat_members(chat_id, filter=enums.ChatMembersFilter.ADMINISTRATORS): + administrators.append(m) # Get bots - bots = list(await app.get_chat_members( - chat_id, - filter=enums.ChatMembersFilter.BOTS)) + bots = [] + async for m in app.get_chat_members(chat_id, filter=enums.ChatMembersFilter.BOTS): + bots.append(m) """ peer = await self.resolve_peer(chat_id) diff --git a/pyrogram/methods/messages/read_chat_history.py b/pyrogram/methods/messages/read_chat_history.py index 8a58fa26..b3cc3bfc 100644 --- a/pyrogram/methods/messages/read_chat_history.py +++ b/pyrogram/methods/messages/read_chat_history.py @@ -47,10 +47,10 @@ class ReadChatHistory: .. code-block:: python # Mark the whole chat as read - await app.read_history(chat_id) + await app.read_chat_history(chat_id) # Mark messages as read only up to the given message id - await app.read_history(chat_id, 12345) + await app.read_chat_history(chat_id, 12345) """ peer = await self.resolve_peer(chat_id)