Showing
1 changed file
with
4 additions
and
3 deletions
... | @@ -75,8 +75,8 @@ bot.onText(/(?!\/)(.+)/, (msg, match) => { | ... | @@ -75,8 +75,8 @@ bot.onText(/(?!\/)(.+)/, (msg, match) => { |
75 | var translate_options = { | 75 | var translate_options = { |
76 | url: translate_api_url, | 76 | url: translate_api_url, |
77 | form: { | 77 | form: { |
78 | - 'source': source, // Translate from source | 78 | + 'source': source, // Before translation |
79 | - 'target': target, // to target | 79 | + 'target': target, // After translation |
80 | 'text': received_msg // Message to translate | 80 | 'text': received_msg // Message to translate |
81 | }, | 81 | }, |
82 | headers: { | 82 | headers: { |
... | @@ -93,7 +93,8 @@ bot.onText(/(?!\/)(.+)/, (msg, match) => { | ... | @@ -93,7 +93,8 @@ bot.onText(/(?!\/)(.+)/, (msg, match) => { |
93 | result.text = objBody.message.result.translatedText; | 93 | result.text = objBody.message.result.translatedText; |
94 | 94 | ||
95 | // Send translated message | 95 | // Send translated message |
96 | - console.log(result.text); | 96 | + console.log('Before: ' + received_msg); |
97 | + console.log('After: ' + result.text); | ||
97 | bot.sendMessage(chatId, result.text); | 98 | bot.sendMessage(chatId, result.text); |
98 | } | 99 | } |
99 | }); | 100 | }); | ... | ... |
-
Please register or login to post a comment