messages.SearchGlobal

class pyrogram.raw.functions.messages.SearchGlobal

Search for messages and peers globally

Details:
  • Layer: 223

  • ID: 4BC6589A

Parameters:
  • q (str) – Query

  • filter (MessagesFilter) – Global search filter

  • min_date (int 32-bit) – If a positive value was specified, the method will return only messages with date bigger than min_date

  • max_date (int 32-bit) – If a positive value was transferred, the method will return only messages with date smaller than max_date

  • offset_rate (int 32-bit) – Initially 0, then set to the next_rate parameter of messages.messagesSlice, or if that is absent, the date of the last returned message.

  • offset_peer (InputPeer) – Offsets for pagination, for more info click here

  • offset_id (int 32-bit) – Offsets for pagination, for more info click here

  • limit (int 32-bit) – Offsets for pagination, for more info click here

  • broadcasts_only (bool, optional) – If set, only returns results from channels (used in the global channel search tab »).

  • groups_only (bool, optional) – Whether to search only in groups

  • users_only (bool, optional) – Whether to search only in private chats

  • folder_id (int 32-bit, optional) – Peer folder ID, for more info click here

Returns:

messages.Messages

TL Schema

messages.searchGlobal#4bc6589a
flags:#
broadcasts_only:flags.1?true
groups_only:flags.2?true
users_only:flags.3?true
folder_id:flags.0?int
q:string
filter:MessagesFilter
min_date:int
max_date:int
offset_rate:int
offset_peer:InputPeer
offset_id:int
limit:int

= messages.Messages

Parameter Tree

SearchGlobal
├── broadcasts_onlytrue (optional)
├── groups_onlytrue (optional)
├── users_onlytrue (optional)
├── folder_idint (optional)
├── qstring
├── filterMessagesFilter
│ │ └── missedtrue (optional)
├── min_dateint
├── max_dateint
├── offset_rateint
├── offset_peerInputPeer
│ ├── InputPeerEmpty
│ ├── InputPeerSelf
│ ├── InputPeerChat
│ │ └── chat_idlong
│ ├── InputPeerUser
│ │ ├── user_idlong
│ │ └── access_hashlong
│ ├── InputPeerChannel
│ │ ├── channel_idlong
│ │ └── access_hashlong
│ │ ├── peerInputPeer
│ │ │ ├── InputPeerEmpty
│ │ │ ├── InputPeerSelf
│ │ │ ├── InputPeerChat
│ │ │ ├── InputPeerUser
│ │ │ ├── InputPeerChannel
│ │ │ ├── InputPeerUserFromMessage
│ │ │ └── InputPeerChannelFromMessage
│ │ ├── msg_idint
│ │ └── user_idlong
│ ├── peerInputPeer
│ │ ├── InputPeerEmpty
│ │ ├── InputPeerSelf
│ │ ├── InputPeerChat
│ │ ├── InputPeerUser
│ │ ├── InputPeerChannel
│ │ ├── InputPeerUserFromMessage
│ │ └── InputPeerChannelFromMessage
│ ├── msg_idint
│ └── channel_idlong
├── offset_idint
└── limitint

Example

await app.invoke(
    SearchGlobal(
        broadcasts_only=None,
        groups_only=None,
        users_only=None,
        folder_id=0,
        q="text",
        filter=InputMessagesFilterEmpty(),
        min_date=0,
        max_date=0,
        offset_rate=0,
        offset_peer=await app.resolve_peer(chat_id),
        offset_id=0,
        limit=0,
    )
)