get_chat_online_count()

Client.get_chat_online_count()

Get the number of members that are currently online in a chat.

Usable by Users Bots
Parameters:

chat_id (int | str) – Unique identifier (int) or username (str) of the target chat. You can also use chat public link in form of t.me/<username> (str).

Returns:

int – On success, the chat members online count is returned.

Example

online = await app.get_chat_online_count(chat_id)
print(online)