Layer 220
method Users Bots
messages.unpinAllMessages#62dd747 flags:# peer:InputPeer top_msg_id:flags.0?int saved_peer_id:flags.1?InputPeer = messages.AffectedHistory;

Parameters

Name Type Description
Flags # Flags, see TL conditional fields
Peer InputPeer Chat where to unpin
TopMsgId flags.0?int Forum topic where to unpin
SavedPeerId flags.1?InputPeer If set, must be equal to the ID of a monoforum topic, and will unpin all messages pinned in the passed monoforum topic.

Possible Errors

Code Type Description
400 CHAT_ADMIN_REQUIRED You must be an admin in this chat to do this.
400 CHAT_NOT_MODIFIED No changes were made to chat information because the new information you passed is identical to the current information.
400 INPUT_USER_DEACTIVATED The specified user was deleted.
400 PEER_ID_INVALID The provided peer id is invalid.

Gogram Example

// MessagesUnpinAllMessages - using Params struct
result, err := client.MessagesUnpinAllMessages(&tg.MessagesUnpinAllMessagesParams{
    Peer: &tg.InputPeerUser{UserID: int64(123456789)},

    // Optional fields:
    // TopMsgId: 0,
    // SavedPeerId: &tg.InputPeerUser{UserID: int64(123456789)},
})
if err != nil {
    // handle error
}
// result is *tg.MessagesAffectedHistory