Skip to main content

messages.toggleDialogPin

Pin/unpin a dialog

func (c *Client) MessagesToggleDialogPin(ctx context.Context, request *MessagesToggleDialogPinRequest) (bool, error)

Calling this method

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

res, err := api.MessagesToggleDialogPin(ctx, &tg.MessagesToggleDialogPinRequest{
// see Parameters
})
if err != nil {
return err
}
_ = res // bool
return nil
})

Parameters

NameTypeRequiredDescription
PinnedboolWhether to pin or unpin the dialog
PeerInputDialogPeerClassyesThe dialog to pin

Returns

bool

Possible errors

CodeTypeDescription
400CHANNEL_PRIVATEYou haven't joined this channel/supergroup.
400PEER_HISTORY_EMPTYYou can't pin an empty chat with a user.
400PEER_ID_INVALIDThe provided peer id is invalid.
400PINNED_DIALOGS_TOO_MUCHToo many pinned dialogs.

References