Skip to content

Commit b777714

Browse files
committed
Document get_chat_members
1 parent f1bb20e commit b777714

1 file changed

Lines changed: 31 additions & 0 deletions

File tree

pyrogram/client/methods/chats/get_chat_members.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,37 @@ def get_chat_members(self,
3636
limit: int = 200,
3737
query: str = "",
3838
filter: str = Filters.ALL):
39+
"""Use this method to get the members list of a chat.
40+
41+
A chat can be either a basic group, a supergroup or a channel.
42+
You must be admin to retrieve the members (also known as "subscribers") list of a channel.
43+
44+
Args:
45+
chat_id (``int`` | ``str``):
46+
Unique identifier (int) or username (str) of the target chat.
47+
For a private channel/supergroup you can use its *t.me/joinchat/* link.
48+
49+
offset (``int``, *optional*):
50+
Sequential number of the first member to be returned.
51+
Defaults to 0 [1]_.
52+
53+
limit (``int``, *optional*):
54+
Limits the number of members to be retrieved.
55+
Defaults to 200, which is also the maximum limit allowed per method call.
56+
57+
query (``str``, *optional*):
58+
Query string to filter members based on their display names and usernames.
59+
Defaults to "" (empty string) [2]_.
60+
61+
filter (``str``, *optional*):
62+
Filter used to select the kind of members you want to retrieve. Only applicable for supergroups
63+
and channels. It can be any of "all", "kicked", "restricted", "bots", "recent" and "administrators".
64+
Defaults to "all".
65+
66+
.. [1] On supergroups and channels you can get up to 10,000 members for a single query string.
67+
68+
.. [2] A query string is applicable only for "all", "kicked" and "restricted" filters only.
69+
"""
3970
peer = self.resolve_peer(chat_id)
4071

4172
if isinstance(peer, types.InputPeerChat):

0 commit comments

Comments
 (0)