Layer 220
MessagesSaveDraft
Save a message draft associated to a chat.
method
Users
messages.saveDraft#54ae308e flags:# no_webpage:flags.1?true invert_media:flags.6?true reply_to:flags.4?InputReplyTo peer:InputPeer message:string entities:flags.3?Vector<MessageEntity> media:flags.5?InputMedia effect:flags.7?long suggested_post:flags.8?SuggestedPost = Bool;
Parameters
| Name | Type | Description |
|---|---|---|
| Flags | # | Flags, see TL conditional fields |
| NoWebpage | flags.1?true | Disable generation of the webpage preview |
| InvertMedia | flags.6?true | If set, any eventual webpage preview will be shown on top of the message instead of at the bottom. |
| ReplyTo | flags.4?InputReplyTo | If set, indicates that the message should be sent in reply to the specified message or story. |
| Peer | InputPeer | Destination of the message that should be sent |
| Message | string | The draft |
| Entities | Vector<MessageEntity> | Message entities for styled text |
| Media | flags.5?InputMedia | Attached media |
| Effect | flags.7?long | Specifies a message effect to use for the message. |
| SuggestedPost | flags.8?SuggestedPost | Used to suggest a post to a channel, see here for more info on the full flow. |
Returns
BoolPossible Errors
| Code | Type | Description |
|---|---|---|
| 400 | ENTITY_BOUNDS_INVALID | A specified entity offset or length is invalid, see here for info on how to properly compute the entity offset/length. |
| 400 | INPUT_USER_DEACTIVATED | The specified user was deleted. |
| 400 | MSG_ID_INVALID | Invalid message ID provided. |
| 400 | PEER_ID_INVALID | The provided peer id is invalid. |
Gogram Example
// MessagesSaveDraft - using Params struct result, err := client.MessagesSaveDraft(&tg.MessagesSaveDraftParams{ Peer: &tg.InputPeerUser{UserID: int64(123456789)}, Message: "...", // Optional fields: // NoWebpage: true, // InvertMedia: true, // ReplyTo: &tg.InputReplyToMessage{ReplyToMsgID: 123}, // Entities: []tg.MessageEntity{&tg.MessageEntityBold{Offset: 0, Length: 4}}, // ... }) if err != nil { // handle error } // result is *tg.Bool