Message TranslationUSER-ONLY
User Walkthrough 8 of 50
Users can translate messages and text into another language.
With getTranslations, you can retrieve the available translation languages.
Translating a Message
translateMessage accepts the target language code, chat identifier, and message identifier.
const translation = await client.translateMessage("en", chatId, messageId);
console.log(translation.text);
translateMessages lets you translate multiple messages at once.
Translating Text
translateText accepts the target language code and a TextToTranslate.
const translation = await client.translateText("en", {
text: "Hola",
entities: [],
});
console.log(translation.text);
With translateTexts, you can translate multiple texts at once.