searchMessages

Search the messages of a chat. User-only.

PARAMETERS
chatId: ID

The identifier of the chat to search the messages in.

query: string

The message search query.

from?: ID

If set, only messages sent by from are returned.

A search filter to apply.

after?: number

A message identifier to start searching after.

messageThreadId?: number

The identifier of a message thread to search in.

limit?: number

The maximum number of results to return. Must be in the range of 1-100. Defaults to 100.

RESULT
SYNTAX
// Required parameters only.
await client.searchMessages(chatId, query);

// Required parameters + optional parameters.
// Any of the optional parameters can be omitted.
await client.searchMessages(chatId, query, {
    from,
    filter,
    after,
    messageThreadId,
    limit,
});