telegram api method · layer 229 · #f2c4f24d
channels.searchPosts
Globally search for posts from public channels » (including those we aren't a member of) containing either a specific hashtag, or a full text query.
definition
channels.searchPosts#f2c4f24d flags:# hashtag:flags.0?string query:flags.1?string offset_rate:int offset_peer:InputPeer offset_id:int limit:int allow_paid_stars:flags.2?long = messages.Messages;
parameters
| name | type | description |
|---|---|---|
flags | # | Flags, see TL conditional fields |
hashtag | string | The hashtag to search, without the # character. |
query | string | The full text query: each user has a limited amount of free full text search slots, after which payment is required, see here » for more info on the full flow. |
offset_rate | int | 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 | Offsets for pagination, for more info click here |
limit | int | Maximum number of results to return, see pagination |
allow_paid_stars | long | For full text post searches (query), allows payment of the specified amount of Stars for the search, see here » for more info on the full flow. |
returns
errors (5)
| code | error | description |
|---|---|---|
| 400 | BUSINESS_CONNECTION_NOT_ALLOWED | This method was invoked over a business connection using invokeWithBusinessConnection, but either (1) we're a user, and users cannot invoke methods over a business connection; (2) we're a bot, but business mode was disabled in @botfather or (3); we're a bot, but this method cannot be invoked over a business connection. |
| 400 | OFFSET_PEER_ID_INVALID | The provided offset peer is invalid. |
| 401 | AUTH_KEY_UNREGISTERED | The specified authorization key is not registered in the system (for example, a PFS temporary key has expired). |
| 403 | PREMIUM_ACCOUNT_REQUIRED | A premium account is required to execute this action. |
| 420 | FROZEN_METHOD_INVALID | The current account is frozen, and thus cannot execute the specified action. |
history
present in layers 180–229 · constructor id changed 1×
| id | layers |
|---|---|
| #d19f987b | 180–210 |
| #f2c4f24d | 211–229 |