Translate a given text
messages.translateNoResult#67ca4737 = messages.TranslatedText;
messages.translateResultText#a214f7d0 text:string = messages.TranslatedText;
---functions---
messages.translateText#24ce6dee flags:# peer:flags.0?InputPeer msg_id:flags.0?int text:flags.1?string from_lang:flags.2?string to_lang:string = messages.TranslatedText;
Parameters
Name |
Type |
Description |
flags |
# |
Flags, see TL conditional fields |
peer |
flags.0?InputPeer |
If the text is a chat message, the peer ID |
msg_id |
flags.0?int |
If the text is a chat message, the message ID |
text |
flags.1?string |
The text to translate |
from_lang |
flags.2?string |
Two-letter ISO 639-1 language code of the language from which the message is translated, if not set will be autodetected |
to_lang |
string |
Two-letter ISO 639-1 language code of the language to which the message is translated |
Result
messages.TranslatedText
Possible errors
Code |
Type |
Description |
400 |
INPUT_TEXT_EMPTY |
The specified text is empty. |
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. |