messages.saveDraft #

Save a message draft associated to a chat.

Layer 223

boolFalse#bc799737 = Bool;
boolTrue#997275b5 = Bool;
---functions---
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 #

NameTypeDescription
flags#Flags, see TL conditional fields
no_webpageflags.1?trueDisable generation of the webpage preview
invert_mediaflags.6?trueIf set, any eventual webpage preview will be shown on top of the message instead of at the bottom.
reply_toflags.4?InputReplyToIf set, indicates that the message should be sent in reply to the specified message or story.
peerInputPeerDestination of the message that should be sent
messagestringThe draft
entitiesflags.3?Vector<MessageEntity>Message entities for styled text
mediaflags.5?InputMediaAttached media
effectflags.7?longSpecifies a message effect » to use for the message.
suggested_postflags.8?SuggestedPostUsed to suggest a post to a channel, see here » for more info on the full flow.

Result #

Bool

Only users can use this method #

Possible errors #

CodeTypeDescription
400CHAT_ADMIN_REQUIREDYou must be an admin in this chat to do this.
403CHAT_WRITE_FORBIDDENYou can't write in this chat.
400ENTITY_BOUNDS_INVALIDA specified entity offset or length is invalid, see here » for info on how to properly compute the entity offset/length.
400INPUT_USER_DEACTIVATEDThe specified user was deleted.
400MSG_ID_INVALIDInvalid message ID provided.
400PEER_ID_INVALIDThe provided peer id is invalid.

Styled text with message entities #

How to create styled text with message entities

Animated message effects #

Telegram allows adding spectacular animated effects to messages you send.

Suggested posts #

Telegram offers a powerful monetization feature to channel administrators: suggested posts.

Message drafts #

How to handle message drafts