Skip to main content

messages.unpinAllMessages

Unpin all pinned messages

func (c *Client) MessagesUnpinAllMessages(ctx context.Context, request *MessagesUnpinAllMessagesRequest) (*MessagesAffectedHistory, error)

Calling this method​

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

res, err := api.MessagesUnpinAllMessages(ctx, &tg.MessagesUnpinAllMessagesRequest{
// see Parameters
})
if err != nil {
return err
}
_ = res // *MessagesAffectedHistory
return nil
})

Parameters​

NameTypeRequiredDescription
PeerInputPeerClassyesChat where to unpin
TopMsgIDint—Forum topic where to unpin
SavedPeerIDInputPeerClass—If set, must be equal to the ID of a monoforum topic, and will unpin all messages pinned in the passed monoforum topic.

Returns​

*MessagesAffectedHistory

Possible errors​

CodeTypeDescription
400CHAT_ADMIN_REQUIREDYou must be an admin in this chat to do this.
400CHAT_NOT_MODIFIEDNo changes were made to chat information because the new information you passed is identical to the current information.
400INPUT_USER_DEACTIVATEDThe specified user was deleted.
400PEER_ID_INVALIDThe provided peer id is invalid.

References​