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
| Name | Type | Required | Description |
|---|---|---|---|
Peer | InputPeerClass | yes | Chat where to unpin |
TopMsgID | int | — | Forum topic where to unpin |
SavedPeerID | InputPeerClass | — | If set, must be equal to the ID of a monoforum topic, and will unpin all messages pinned in the passed monoforum topic. |
Returns
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. |
References
- Official documentation
- Generated Go reference
- TL definition:
messages.unpinAllMessages#62dd747