messages.SearchGlobal

class pyrogram.raw.functions.messages.SearchGlobal

Search for messages and peers globally

Details:
  • Layer: 227

  • 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_only → true (optional)
├── groups_only → true (optional)
├── users_only → true (optional)
├── folder_id → int (optional)
├── q → string
├── filter → MessagesFilter
│ │ └── missed → true (optional)
├── min_date → int
├── max_date → int
├── offset_rate → int
├── offset_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
├── offset_id → int
└── limit → int

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,
    )
)