telegram api method · layer 229 · #a5eec345

messages.translateText

usable by users

Translate a given text.

definition

messages.translateText#a5eec345 flags:# peer:flags.0?InputPeer id:flags.0?Vector<int> text:flags.1?Vector<TextWithEntities> to_lang:string tone:flags.2?string = messages.TranslatedText;

parameters

nametypedescription
flags#Flags, see TL conditional fields
peerflags.0?InputPeerIf the text is a chat message, the peer ID
idflags.0?Vector<int>A list of message IDs to translate
textflags.1?Vector<TextWithEntities>A list of styled messages to translate
to_langstringTwo-letter ISO 639-1 language code of the language to which the message is translated
toneflags.2?string

returns

messages.TranslatedText

errors (11)

codeerrordescription
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.
400INPUT_TEXT_EMPTYThe specified text is empty.
400INPUT_TEXT_TOO_LONGThe specified text is too long.
400MSG_ID_INVALIDInvalid message ID provided.
400PEER_ID_INVALIDThe provided peer id is invalid.
400TO_LANG_INVALIDThe specified destination language is invalid.
400TRANSLATE_REQ_QUOTA_EXCEEDEDTranslation is currently unavailable due to a temporary server-side lack of resources.
401AUTH_KEY_UNREGISTEREDThe specified authorization key is not registered in the system (for example, a PFS temporary key has expired).
406TRANSLATIONS_DISABLEDTranslations are unavailable, a detailed and localized description for the error will be emitted via an updateServiceNotification as specified here ».
500TRANSLATE_REQ_FAILEDTranslation failed, please try again later.
500TRANSLATION_TIMEOUTA timeout occurred while translating the specified text.

history

present in layers 137–229 · constructor id changed 2×

idlayers
#24ce6dee137–151
#63183030152–223
#a5eec345224–229