kykint

Merge remote-tracking branch 'origin/h_command' into dev

Showing 1 changed file with 26 additions and 0 deletions
...@@ -364,3 +364,29 @@ bot.on('callback_query', (query) => { ...@@ -364,3 +364,29 @@ bot.on('callback_query', (query) => {
364 bot.answerCallbackQuery(queryId, options); 364 bot.answerCallbackQuery(queryId, options);
365 }) 365 })
366 }); 366 });
367 +
368 +bot.onText(/^\/(h|help)/, (msg, match) => {
369 + const chatId = msg.chat.id;
370 + const helpText = "/t\n사용법:[msg] 또는 /t [msg] 또는 reply /t\n1. msg를 유저의 기본언어->\
371 +영어, 외국어->유저의 기본언어로 번역합니다.\n2. /l 커맨드를 이용해 타겟 언어를 설정하면 유저의\
372 +본언어가 타겟 언어로 번역됩니다.\n\n/l\n사용법: /l\n1. 언어를 번역할 타겟 언어를 설정할 수\
373 +습니다.\n2. 언어 코드를 알고 싶다면 /lc 를 참고하세요.\n3. 가능한 번역을 알고싶다면 /pt 를 참고\
374 +하세요.\n\n이미지 속 텍스트 번역\n사용법: 사진을 보내세요!\n1. 이미지 속 텍스트를 번역해줍니다.\
375 +역 옵션은 t와 같습니다."
376 + bot.sendMessage(chatId, helpText);
377 +});
378 +
379 +bot.onText(/^\/pt/, (msg, match) => {
380 + const chatId = msg.chat.id;
381 + const helpText = "가능한 번역:\nko <-> en/ja/zh-CN/zh-TW/vi/id/th/de/ru/es/it/fr\nen <->\
382 +a/zh-CN/zh-TW/fr\nja <-> zh-CN/zh-TW\nzh-CN <-> zh-TW"
383 + bot.sendMessage(chatId, helpText);
384 +});
385 +
386 +bot.onText(/^\/lc/, (msg, match) => {
387 + const chatId = msg.chat.id;
388 + const helpText = "언어 코드:\nko = korean\nen = english\nja = japanese\nzh-CN = Simplified\
389 +hinese\nzh-TW = Traditional Chinese\nvi = Vietnamese\nid = Indonesian\nth = Thai\nde = German\nru\
390 + Russian\nes = Espanyan(Spanish)\nit = Italian\nfr = French"
391 + bot.sendMessage(chatId, helpText);
392 +});
......