Layer 220
ChannelsSearchPosts
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.
method
Users
Parameters
| Name | Type | Description |
|---|---|---|
| Flags | # | Flags, see TL conditional fields |
| Hashtag | flags.0?string | The hashtag to search, without the # character. |
| Query | flags.1?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. |
| OffsetRate | int | Initially 0, then set to the next_rate parameter of messages. messages Slice, or if that is absent, the date of the last returned message. |
| OffsetPeer | InputPeer | Offsets for pagination, for more info click here |
| OffsetId | int | Offsets for pagination, for more info click here |
| Limit | int | Maximum number of results to return, see pagination |
| AllowPaidStars | flags.2?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
messages.MessagesPossible Errors
| Code | Type | Description |
|---|---|---|
| 420 | FROZEN_METHOD_INVALID | The current account is frozen, and thus cannot execute the specified action. |
Gogram Example
// ChannelsSearchPosts - using Params struct result, err := client.ChannelsSearchPosts(&tg.ChannelsSearchPostsParams{ OffsetRate: 0, OffsetPeer: &tg.InputPeerUser{UserID: int64(123456789)}, OffsetId: 0, Limit: 0, // Optional fields: // Hashtag: "...", // Query: "...", // AllowPaidStars: int64(0), }) if err != nil { // handle error } // result is *tg.MessagesMessages