kykint

Print source message to log as well

Showing 1 changed file with 4 additions and 3 deletions
......@@ -75,8 +75,8 @@ bot.onText(/(?!\/)(.+)/, (msg, match) => {
var translate_options = {
url: translate_api_url,
form: {
'source': source, // Translate from source
'target': target, // to target
'source': source, // Before translation
'target': target, // After translation
'text': received_msg // Message to translate
},
headers: {
......@@ -93,7 +93,8 @@ bot.onText(/(?!\/)(.+)/, (msg, match) => {
result.text = objBody.message.result.translatedText;
// Send translated message
console.log(result.text);
console.log('Before: ' + received_msg);
console.log('After: ' + result.text);
bot.sendMessage(chatId, result.text);
}
});
......