Layer 227
method Users
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
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.

Gogram Example

// ChannelsSearchPosts - using Params struct
result, err := client.ChannelsSearchPosts(&tg.ChannelsSearchPostsParams{
    Hashtag: "Hello, World!",
    Query: "Hello, World!",
    OffsetRate: 42,
    OffsetPeer: &tg.InputPeerUser{UserID: int64(777000)},
    OffsetId: 42,
    Limit: 42,
    AllowPaidStars: nil,
})
if err != nil {
    // handle error
}
// result is *tg.MessagesMessages

Possible Errors

Code Type Description
420 FROZEN_METHOD_INVALID The current account is frozen, and thus cannot execute the specified action.
400 OFFSET_PEER_ID_INVALID The provided offset peer is invalid.
403 PREMIUM_ACCOUNT_REQUIRED A premium account is required to execute this action.