Layer 220
MessagesToggleDialogPin
Pin/unpin a dialog
method
Users
messages.toggleDialogPin#a731e257 flags:# pinned:flags.0?true peer:InputDialogPeer = Bool;
Parameters
| Name | Type | Description |
|---|---|---|
| Flags | # | Flags, see TL conditional fields |
| Pinned | flags.0?true | Whether to pin or unpin the dialog |
| Peer | InputDialogPeer | The dialog to pin |
Returns
BoolPossible 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. |
Gogram Example
// MessagesToggleDialogPin - using Params struct result, err := client.MessagesToggleDialogPin(&tg.MessagesToggleDialogPinParams{ Peer: &tg.InputDialogPeer{}, // Optional fields: // Pinned: true, }) if err != nil { // handle error } // result is *tg.Bool