Layer 227
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 |
|---|---|---|
| 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 | flags .3? 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
BoolGogram Example
// MessagesSaveDraft - using Params struct result, err := client.MessagesSaveDraft(&tg.MessagesSaveDraftParams{ NoWebpage: nil, InvertMedia: nil, ReplyTo: nil, Peer: &tg.InputPeerUser{UserID: int64(777000)}, Message: "Hello, World!", Entities: nil, Media: nil, Effect: nil, // ... }) if err != nil { // handle error } // result is *tg.Bool
Possible Errors
| Code | Type | Description |
|---|---|---|
| 400 | CHAT_ADMIN_REQUIRED | You must be an admin in this chat to do this. |
| 403 | CHAT_WRITE_FORBIDDEN | You can't write in this chat. |
| 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. |