GetSearchCountersRequest

Only users can use this method. See code examples.

---functions---
messages.getSearchCounters#00ae7cc1 flags:# peer:InputPeer top_msg_id:flags.0?int filters:Vector<MessagesFilter> = Vector<messages.SearchCounter>

Returns

A list of the following type is returned.

messages.SearchCounter

This type can only be an instance of:

SearchCounter

Parameters

peerInputPeerAnything entity-like will work if the library can find its Input version (e.g., usernames, Peer, User or Channel objects, etc.).
filtersMessagesFilterA list must be supplied.
top_msg_idintThis argument defaults to None and can be omitted.

Known RPC errors

This request can't cause any RPC error as far as we know.

Example

from telethon.sync import TelegramClient
from telethon import functions, types

with TelegramClient(name, api_id, api_hash) as client:
    result = client(functions.messages.GetSearchCountersRequest(
        peer='username',
        filters=[types.InputMessagesFilterPhotos()],
        top_msg_id=42
    ))
    for x in result:
        print(x)