GetSearchCountersRequest
Only users can use this request. See code examples.
---functions--- messages.getSearchCounters#1bbcf300 flags:# peer:InputPeer saved_peer_id:flags.2?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
| peer | InputPeer | Anything entity-like will work if the library can find its Input version (e.g., usernames, Peer, User or Channel objects, etc.). |
| filters | MessagesFilter | A list must be supplied. |
| saved_peer_id | InputPeer | This argument defaults to None and can be omitted. Anything entity-like will work if the library can find its Input version (e.g., usernames, Peer, User or Channel objects, etc.). |
| top_msg_id | int | This 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()],
saved_peer_id='username',
top_msg_id=42
))
for x in result:
print(x)