Skip to main content

messages.updatePinnedForumTopic

Pin or unpin forum topics

func (c *Client) MessagesUpdatePinnedForumTopic(ctx context.Context, request *MessagesUpdatePinnedForumTopicRequest) (UpdatesClass, error)

Calling this method

client.Run(ctx, func(ctx context.Context) error {
api := client.API()

res, err := api.MessagesUpdatePinnedForumTopic(ctx, &tg.MessagesUpdatePinnedForumTopicRequest{
// see Parameters
})
if err != nil {
return err
}
_ = res // UpdatesClass
return nil
})

Parameters

NameTypeRequiredDescription
PeerInputPeerClassyesThe supergroup forum, private chat (for forum-enabled bots) or bot forum (for users) where the topic is located.
TopicIDintyesForum topic ID
PinnedboolyesWhether to pin or unpin the topic

Returns

UpdatesClass

Possible errors

CodeTypeDescription
400CHANNEL_INVALIDThe provided channel is invalid.

References