messages.search
Gets back found messages
Example
TL schema
Parameters
Name | Type | Description |
flags | Flags, see TL conditional fields | |
peer | User or chat, histories with which are searched, or (inputPeerEmpty) constructor for global search | |
q | Text search request | |
from_id | Only return messages sent by the specified user ID | |
top_msg_id | ||
filter | Filter to return only specified message types | |
min_date | If a positive value was transferred, only messages with a sending date bigger than the transferred one will be returned | |
max_date | If a positive value was transferred, only messages with a sending date smaller than the transferred one will be returned | |
offset_id | Only return messages starting from the specified message ID | |
add_offset | ||
limit | ||
max_id | ||
min_id | ||
hash |
Result
Possible errors
Code | Type | Description |
400 | CHANNEL_INVALID | The provided channel is invalid |
400 | CHANNEL_PRIVATE | You haven't joined this channel/supergroup |
400 | CHAT_ADMIN_REQUIRED | You must be an admin in this chat to do this |
400 | INPUT_CONSTRUCTOR_INVALID | The provided constructor is invalid |
400 | INPUT_USER_DEACTIVATED | The specified user was deleted |
400 | MSG_ID_INVALID | Invalid message ID provided |
400 | PEER_ID_INVALID | The provided peer id is invalid |
400 | PEER_ID_NOT_SUPPORTED | The provided peer ID is not supported |
400 | SEARCH_QUERY_EMPTY | The search query is empty |
400 | USER_ID_INVALID | The provided user ID is invalid |
Can bots use this methd ?
yes
Related pages
An empty constructor, no user or chat is defined.
Telegram allows commenting on a channel post or on a generic supergroup message, thanks to message threads.
How to fetch results from large lists of objects.
Last updated