이유혁

replying message modify

Showing 1 changed file with 8 additions and 8 deletions
...@@ -86,25 +86,25 @@ const option_maker = (api_connector, event) => { ...@@ -86,25 +86,25 @@ const option_maker = (api_connector, event) => {
86 if (detect_body.langCode == 'ko') { 86 if (detect_body.langCode == 'ko') {
87 target = 'en'; 87 target = 'en';
88 switch (event.message.text.slice(-3)) { 88 switch (event.message.text.slice(-3)) {
89 - case ':cn': 89 + case '.cn':
90 target = 'zh-CN'; 90 target = 'zh-CN';
91 break; 91 break;
92 - case ':tw': 92 + case '.tw':
93 target = 'zh-TW'; 93 target = 'zh-TW';
94 break; 94 break;
95 - case ':es': 95 + case '.es':
96 target = 'es'; 96 target = 'es';
97 break; 97 break;
98 - case ':fr': 98 + case '.fr':
99 target = 'fr'; 99 target = 'fr';
100 break; 100 break;
101 - case ':vi': 101 + case '.vi':
102 target = 'vi'; 102 target = 'vi';
103 break; 103 break;
104 - case ':th': 104 + case '.th':
105 target = 'th'; 105 target = 'th';
106 break; 106 break;
107 - case ':id': 107 + case '.id':
108 target = 'id'; 108 target = 'id';
109 break; 109 break;
110 default: 110 default:
...@@ -116,7 +116,7 @@ const option_maker = (api_connector, event) => { ...@@ -116,7 +116,7 @@ const option_maker = (api_connector, event) => {
116 116
117 var options = { 117 var options = {
118 url: translate_api_url, 118 url: translate_api_url,
119 - form: {'source':detect_body.langCode, 'target': target, 'text':event.message.text}, 119 + form: {'source':detect_body.langCode, 'target': target, 'text':event.message.text.slice(0,-3)},
120 headers: {'X-Naver-Client-Id': client_id, 'X-Naver-Client-Secret': client_secret} 120 headers: {'X-Naver-Client-Id': client_id, 'X-Naver-Client-Secret': client_secret}
121 }; 121 };
122 resolve(options); 122 resolve(options);
......