Last updated 4 years ago
Was this helpful?
Get the number of results that would be found by a call with the same parameters
const {Api, TelegramClient} = require('telegram'); const {StringSession} = require('telegram/sessions'); const session = new StringSession(''); const client = new TelegramClient(session, apiId, apiHash, {}); (async function run() { const result = await client.invoke(new Api.messages.getSearchCounters({ peer: new Api.InputPeer({...}), filters: [new Api.MessagesFilter({...})], })); console.log(result); // prints the result })();
import {Api, TelegramClient} from 'telegram'; import {StringSession} from 'telegram/sessions'; const session = new StringSession(''); const client = new TelegramClient(session, apiId, apiHash, {}); (async function run() { const result: Api.Vector<messages.SearchCounter> = await client.invoke(new Api.messages.getSearchCounters({ peer: new Api.InputPeer({...}), filters: [new Api.MessagesFilter({...})], })); console.log(result); // prints the result })();
---functions--- messages.getSearchCounters#732eef00 peer:InputPeer filters:Vector<MessagesFilter> = Vector<messages.SearchCounter>;
Name
Type
Description
peer
Peer where to search
filters
Search filters
Code
Gets back found messages
< >