telegram api method · layer 229 · #b106e66c

messages.editMessage

usable by users and bots

Edit message

definition

messages.editMessage#b106e66c flags:# no_webpage:flags.1?true invert_media:flags.16?true peer:InputPeer id:int message:flags.11?string media:flags.14?InputMedia reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector<MessageEntity> schedule_date:flags.15?int schedule_repeat_period:flags.18?int quick_reply_shortcut_id:flags.17?int rich_message:flags.23?InputRichMessage = Updates;

parameters

nametypedescription
flags#Flags, see TL conditional fields
no_webpageflags.1?trueDisable webpage preview
invert_mediaflags.16?trueIf set, any eventual webpage preview will be shown on top of the message instead of at the bottom.
peerInputPeerWhere was the message sent
idintID of the message to edit
messageflags.11?stringNew message
mediaflags.14?InputMediaNew attached media
reply_markupflags.2?ReplyMarkupReply markup for inline keyboards
entitiesflags.3?Vector<MessageEntity>Message entities for styled text
schedule_dateflags.15?intScheduled message date for scheduled messages
schedule_repeat_periodflags.18?int
quick_reply_shortcut_idflags.17?intIf specified, edits a quick reply shortcut message, instead ».
rich_messageflags.23?InputRichMessage

returns

Updates

errors (54)

codeerrordescription
400BOT_DOMAIN_INVALIDBot domain invalid.
400BOT_INVALIDThis is not a valid bot.
400BUSINESS_CONNECTION_INVALIDThe connection_id passed to the wrapping invokeWithBusinessConnection call is invalid.
400BUSINESS_CONNECTION_NOT_ALLOWEDThis method was invoked over a business connection using invokeWithBusinessConnection, but either (1) we're a user, and users cannot invoke methods over a business connection; (2) we're a bot, but business mode was disabled in @botfather or (3); we're a bot, but this method cannot be invoked over a business connection.
400BUSINESS_PEER_INVALIDMessages can't be set to the specified peer through the current business connection.
400BUTTON_COPY_TEXT_INVALIDThe specified keyboardButtonCopy.copy_text is invalid.
400BUTTON_DATA_INVALIDThe data of one or more of the buttons you provided is invalid.
400BUTTON_TYPE_INVALIDThe type of one or more of the buttons you provided is invalid.
400BUTTON_URL_INVALIDButton URL invalid.
400BUTTON_USER_PRIVACY_RESTRICTEDThe privacy setting of the user specified in a inputKeyboardButtonUserProfile button do not allow creating such a button.
400CHANNEL_INVALIDThe provided channel is invalid.
400CHANNEL_PRIVATEYou haven't joined this channel/supergroup.
400CHAT_ADMIN_REQUIREDYou must be an admin in this chat to do this.
400CHAT_FORWARDS_RESTRICTEDYou can't forward messages from a protected chat.
400DOCUMENT_INVALIDThe specified document is invalid.
400ENTITIES_TOO_LONGYou provided too many styled message entities.
400ENTITY_BOUNDS_INVALIDA specified entity offset or length is invalid, see here » for info on how to properly compute the entity offset/length.
400FILE_PARTS_INVALIDThe number of file parts is invalid.
400IMAGE_PROCESS_FAILEDFailure while processing image.
400INPUT_USER_DEACTIVATEDThe specified user was deleted.
400MEDIA_CAPTION_TOO_LONGThe caption is too long.
400MEDIA_EMPTYThe provided media object is invalid.
400MEDIA_GROUPED_INVALIDYou tried to send media of different types in an album.
400MEDIA_INVALIDMedia invalid.
400MEDIA_NEW_INVALIDThe new media is invalid.
400MEDIA_PREV_INVALIDPrevious media invalid.
400MEDIA_TTL_INVALIDThe specified media TTL is invalid.
400MESSAGE_EDIT_TIME_EXPIREDYou can't edit this message anymore, too much time has passed since its creation.
400MESSAGE_EMPTYThe provided message is empty.
400MESSAGE_ID_INVALIDThe provided message id is invalid.
400MESSAGE_NOT_MODIFIEDThe provided message data is identical to the previous message data, the message wasn't modified.
400MESSAGE_TOO_LONGThe provided message is too long.
400MSG_ID_INVALIDInvalid message ID provided.
400PEER_ID_INVALIDThe provided peer id is invalid.
400PEER_TYPES_INVALIDThe passed keyboardButtonSwitchInline.peer_types field is invalid.
400PHOTO_EXT_INVALIDThe extension of the photo is invalid.
400PHOTO_INVALID_DIMENSIONSThe photo dimensions are invalid.
400PHOTO_SAVE_FILE_INVALIDInternal issues, try again later.
400REPLY_MARKUP_INVALIDThe provided reply markup is invalid.
400REPLY_MARKUP_TOO_LONGThe specified reply_markup is too long.
400SCHEDULE_DATE_INVALIDInvalid schedule date provided.
400TODO_ITEM_DUPLICATEDuplicate checklist items detected.
400TODO_ITEMS_EMPTYA checklist was specified, but no checklist items were passed.
400USER_BANNED_IN_CHANNELYou're banned from sending messages in supergroups/channels.
400WEBPAGE_NOT_FOUNDA preview for the specified webpage url could not be generated.
401AUTH_KEY_UNREGISTEREDThe specified authorization key is not registered in the system (for example, a PFS temporary key has expired).
403CHAT_ADMIN_REQUIREDYou must be an admin in this chat to do this.
403CHAT_SEND_GIFS_FORBIDDENYou can't send gifs in this chat.
403CHAT_WRITE_FORBIDDENYou can't write in this chat.
403INLINE_BOT_REQUIREDOnly the inline bot can edit message.
403MESSAGE_AUTHOR_REQUIREDMessage author required.
406CHANNEL_PRIVATEYou haven't joined this channel/supergroup.
406EDIT_MESSAGE_TEMP_RESTRICTEDMessage editing is temporarily forbidden for this user due to regulatory restrictions.
500MSG_WAIT_FAILEDA waiting call returned an error.

history

present in layers 62–229 · constructor id changed 7×

idlayers
#ce91e4ca62–71
#05d1b8dd72–78
#c000e4c879–90
#d116f31e91–104
#48f71778105–175
#dfd14005176–216
#51e842e1217–226
#b106e66c227–229