# A way to get chat users via aiotdlib library API Telegram

**URL:** <https://discuss.python.org/t/a-way-to-get-chat-users-via-aiotdlib-library-api-telegram/21161>\
**Category:** Python Help\
**Created:** [November 17, 2022, 4:18am UTC](https://discuss.python.org/t/a-way-to-get-chat-users-via-aiotdlib-library-api-telegram/21161 "2022-11-17T04:18:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![gandonio](https://avatars.discourse-cdn.com/v4/letter/g/97f17d/32.png) [@gandonio](https://discuss.python.org/u/gandonio)\
**Post date:** [November 17, 2022, 4:18am UTC](https://discuss.python.org/t/a-way-to-get-chat-users-via-aiotdlib-library-api-telegram/21161/1 "2022-11-17T04:18:49Z")

</div>

Good afternoon. To call the searchChatMemers method from the Telegram Api, I used the python-telegram library. By writing this code:

```auto
params = {"chat_id": chat_id, "query": "a", "limit": 150}
res = telegram.call_method("searchChatMembers", params=params)
res.wait()
print(res.error_info)

```

After several runs I realized that the filter parameter could not be ignored. Having studied the Internet on this issue, I learned that as a filter there should be objects of the ChatMembersFilter class from the same api. I decided to create these objects through the aiotdlib library, because I found this class in it. Next, I tried to create a class object like this:

```auto
from aiotdlib.api import ChatMembersFilterMembers
filter = ChatMembersFilterMembers()
filter.ID = chat_id

```

Somehow get chat participants out of it, since the documentation for the class (here - [TDLib: chatMembersFilterMembers Class Reference](https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1chat_members_filter_members.html)) says that the class returns users, but I did not understand how to do it. Please help with this!
