telegram api method · layer 229 · #a5eec345
messages.translateText
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
| name | type | description |
|---|---|---|
flags | # | Flags, see TL conditional fields |
peer | InputPeer | If the text is a chat message, the peer ID |
id | Vector<int> | A list of message IDs to translate |
text | Vector<TextWithEntities> | A list of styled messages to translate |
to_lang | string | Two-letter ISO 639-1 language code of the language to which the message is translated |
tone | string |
returns
errors (11)
| code | error | description |
|---|---|---|
| 400 | BUSINESS_CONNECTION_NOT_ALLOWED | This 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. |
| 400 | INPUT_TEXT_EMPTY | The specified text is empty. |
| 400 | INPUT_TEXT_TOO_LONG | The specified text is too long. |
| 400 | MSG_ID_INVALID | Invalid message ID provided. |
| 400 | PEER_ID_INVALID | The provided peer id is invalid. |
| 400 | TO_LANG_INVALID | The specified destination language is invalid. |
| 400 | TRANSLATE_REQ_QUOTA_EXCEEDED | Translation is currently unavailable due to a temporary server-side lack of resources. |
| 401 | AUTH_KEY_UNREGISTERED | The specified authorization key is not registered in the system (for example, a PFS temporary key has expired). |
| 406 | TRANSLATIONS_DISABLED | Translations are unavailable, a detailed and localized description for the error will be emitted via an updateServiceNotification as specified here ». |
| 500 | TRANSLATE_REQ_FAILED | Translation failed, please try again later. |
| 500 | TRANSLATION_TIMEOUT | A timeout occurred while translating the specified text. |
history
present in layers 137–229 · constructor id changed 2×
| id | layers |
|---|---|
| #24ce6dee | 137–151 |
| #63183030 | 152–223 |
| #a5eec345 | 224–229 |