SearchRequest

Bots can't use this method.

---functions---
messages.search#8614ef68 flags:# peer:InputPeer q:string from_id:flags.0?InputUser filter:MessagesFilter min_date:date max_date:date offset_id:int add_offset:int limit:int max_id:int min_id:int hash:int = messages.Messages

Returns

messages.Messages

This type can be an instance of either:

ChannelMessagesMessages
MessagesNotModifiedMessagesSlice

Parameters

peerInputPeerAnything entity-like will work if the library can find its Input version (e.g., usernames, Peer, User or Channel objects, etc.).
qstring
filterMessagesFilter
min_datedate
max_datedate
offset_idint
add_offsetint
limitint
max_idint
min_idint
hashint
from_idInputUserThis argument can be omitted. Anything entity-like will work if the library can find its Input version (e.g., usernames, Peer, User or Channel objects, etc.).

Known RPC errors

This request can cause 7 known errors:

ChatAdminRequiredErrorChat admin privileges are required to do that in the specified chat (for example, to send a message in a channel which is not yours).
InputConstructorInvalidErrorThe provided constructor is invalid.
InputUserDeactivatedErrorThe specified user was deleted.
PeerIdInvalidErrorAn invalid Peer was used. Make sure to pass the right peer type.
PeerIdNotSupportedErrorThe provided peer ID is not supported.
SearchQueryEmptyErrorThe search query is empty.
UserIdInvalidErrorInvalid object ID for an user. Make sure to pass the right types, for instance making sure that the request is designed for users or otherwise look for a different one more suited.

You can import these from telethon.errors.