messages.saveDraft
Save a message draft associated to a chat.
func (c *Client) MessagesSaveDraft(ctx context.Context, request *MessagesSaveDraftRequest) (bool, error)
Calling this method
client.Run(ctx, func(ctx context.Context) error {
api := client.API()
res, err := api.MessagesSaveDraft(ctx, &tg.MessagesSaveDraftRequest{
// see Parameters
})
if err != nil {
return err
}
_ = res // bool
return nil
})
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
NoWebpage | bool | — | Disable generation of the webpage preview |
InvertMedia | bool | — | If set, any eventual webpage preview will be shown on top of the message instead of at the bottom. |
ReplyTo | InputReplyToClass | — | If set, indicates that the message should be sent in reply to the specified message or story. |
Peer | InputPeerClass | yes | Destination of the message that should be sent |
Message | string | yes | The draft |
Entities | []MessageEntityClass | — | Message entities for styled text |
Media | InputMediaClass | — | Attached media |
Effect | int64 | — | Specifies a message effect » to use for the message. |
SuggestedPost | SuggestedPost | — | Used to suggest a post to a channel, see here » for more info on the full flow. |
RichMessage | InputRichMessageClass | — | RichMessage field of MessagesSaveDraftRequest. |
Returns
bool
Possible errors
| Code | Type | Description |
|---|---|---|
| 400 | CHAT_ADMIN_REQUIRED | You must be an admin in this chat to do this. |
| 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. |
References
- Official documentation
- Generated Go reference
- TL definition:
messages.saveDraft#ad0fa15c