messages.GetSearchCounters

class pyrogram.raw.functions.messages.GetSearchCounters

Get the number of results that would be found by a messages.search call with the same parameters

Details:
  • Layer: 227

  • ID: 1BBCF300

Parameters:
  • peer (InputPeer) – Peer where to search

  • filters (List of MessagesFilter) – Search filters

  • saved_peer_id (InputPeer, optional) – Search within the saved message dialog » with this ID.

  • top_msg_id (int 32-bit, optional) – If set, consider only messages within the specified forum topic

Returns:

List of messages.SearchCounter

TL Schema

messages.getSearchCounters#1bbcf300
flags:#
peer:InputPeer
saved_peer_id:flags.2?InputPeer
top_msg_id:flags.0?int
filters:Vector<MessagesFilter>

= Vector<messages.SearchCounter>

Parameter Tree

GetSearchCounters
├── peer → InputPeer
│ ├── InputPeerEmpty
│ ├── InputPeerSelf
│ ├── InputPeerChat
│ │ └── chat_id → long
│ ├── InputPeerUser
│ │ ├── user_id → long
│ │ └── access_hash → long
│ ├── InputPeerChannel
│ │ ├── channel_id → long
│ │ └── access_hash → long
│ │ ├── peer → InputPeer
│ │ │ ├── InputPeerEmpty
│ │ │ ├── InputPeerSelf
│ │ │ ├── InputPeerChat
│ │ │ ├── InputPeerUser
│ │ │ ├── InputPeerChannel
│ │ │ ├── InputPeerUserFromMessage
│ │ │ └── InputPeerChannelFromMessage
│ │ ├── msg_id → int
│ │ └── user_id → long
│ ├── peer → InputPeer
│ │ ├── InputPeerEmpty
│ │ ├── InputPeerSelf
│ │ ├── InputPeerChat
│ │ ├── InputPeerUser
│ │ ├── InputPeerChannel
│ │ ├── InputPeerUserFromMessage
│ │ └── InputPeerChannelFromMessage
│ ├── msg_id → int
│ └── channel_id → long
├── saved_peer_id → InputPeer (optional)
│ ├── InputPeerEmpty
│ ├── InputPeerSelf
│ ├── InputPeerChat
│ │ └── chat_id → long
│ ├── InputPeerUser
│ │ ├── user_id → long
│ │ └── access_hash → long
│ ├── InputPeerChannel
│ │ ├── channel_id → long
│ │ └── access_hash → long
│ │ ├── peer → InputPeer
│ │ │ ├── InputPeerEmpty
│ │ │ ├── InputPeerSelf
│ │ │ ├── InputPeerChat
│ │ │ ├── InputPeerUser
│ │ │ ├── InputPeerChannel
│ │ │ ├── InputPeerUserFromMessage
│ │ │ └── InputPeerChannelFromMessage
│ │ ├── msg_id → int
│ │ └── user_id → long
│ ├── peer → InputPeer
│ │ ├── InputPeerEmpty
│ │ ├── InputPeerSelf
│ │ ├── InputPeerChat
│ │ ├── InputPeerUser
│ │ ├── InputPeerChannel
│ │ ├── InputPeerUserFromMessage
│ │ └── InputPeerChannelFromMessage
│ ├── msg_id → int
│ └── channel_id → long
├── top_msg_id → int (optional)
└── filters → Vector < MessagesFilter >

Example

await app.invoke(
    GetSearchCounters(
        peer=await app.resolve_peer(chat_id),
        saved_peer_id=await app.resolve_peer(chat_id),
        top_msg_id=0,
        filters=[
                InputMessagesFilterEmpty()
            ],
    )
)