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
| Name | Type | Required | Description |
|---|---|---|---|
Pinned | bool | — | Whether to pin or unpin the dialog |
Peer | InputDialogPeerClass | yes | The dialog to pin |
Returns
bool
Possible errors
| Code | Type | Description |
|---|---|---|
| 400 | CHANNEL_PRIVATE | You haven't joined this channel/supergroup. |
| 400 | PEER_HISTORY_EMPTY | You can't pin an empty chat with a user. |
| 400 | PEER_ID_INVALID | The provided peer id is invalid. |
| 400 | PINNED_DIALOGS_TOO_MUCH | Too many pinned dialogs. |
References
- Official documentation
- Generated Go reference
- TL definition:
messages.toggleDialogPin#a731e257