From 553b8c26e8e78285e0df8ab6678ca728a0b0d24a Mon Sep 17 00:00:00 2001 From: "namwoo.kim" Date: Sat, 21 Mar 2020 14:20:37 +0900 Subject: [PATCH] kalink --- kalink.js | 32 ++++++++++++++++++++++++++++++++ main.js | 34 ++-------------------------------- update.bat | 3 ++- 3 files changed, 36 insertions(+), 33 deletions(-) diff --git a/kalink.js b/kalink.js index e69de29..6e0439f 100644 --- a/kalink.js +++ b/kalink.js @@ -0,0 +1,32 @@ +exports.test = +{ + "link_ver": "4.0", + "template_object": + { + "object_type": "feed", + "button_title": "버튼", + + "content": { + "title": "제목", + "image_url": "http://k.kakaocdn.net/dn/dEwroC/btqgdYG36hU/1zQbPe8ZLpGGmoMkrf0iX0/kakaolink40_original.png", + "link": + { + "web_url": "naver.com", + "mobile_web_url": "naver.com" + }, + "description": "설명" + }, + + "buttons": [ + { + "title": "버튼", + "link": + { + "web_url": "noirstar.tistory.com", + "mobile_web_url": "noirstar.tistory.com" + } + } + ] + + } +}; \ No newline at end of file diff --git a/main.js b/main.js index f1aca63..1d53b62 100644 --- a/main.js +++ b/main.js @@ -7,6 +7,7 @@ const coronaM = Bridge.getScopeOf("corona.js"); const lottoM = Bridge.getScopeOf("lotto.js"); const Jsoup = org.jsoup.Jsoup; const env = require('env.js'); +const kalink = require('kalink.js'); const kaling = require('kaling.js').Kakao(); const Kakao = new kaling; @@ -137,38 +138,7 @@ function response(room, msg, sender, isGroupChat, replier, ImageDB, packageName, //테스트 if (msg == ".테") { try{ - Kakao.send(room, - { - "link_ver": "4.0", - "template_object": - { - "object_type": "feed", - "button_title": "버튼", - - "content": { - "title": "제목", - "image_url": "http://k.kakaocdn.net/dn/dEwroC/btqgdYG36hU/1zQbPe8ZLpGGmoMkrf0iX0/kakaolink40_original.png", - "link": - { - "web_url": "naver.com", - "mobile_web_url": "naver.com" - }, - "description": "설명" - }, - - "buttons": [ - { - "title": "버튼", - "link": - { - "web_url": "noirstar.tistory.com", - "mobile_web_url": "noirstar.tistory.com" - } - } - ] - - } - }); + Kakao.send(room,kalink.test); }catch(e) { replier.reply(e); } diff --git a/update.bat b/update.bat index 163c9e0..ce387cc 100644 --- a/update.bat +++ b/update.bat @@ -8,4 +8,5 @@ adb push corona.js storage/emulated/legacy/katalkbot/Bots/corona/index.js adb push lotto.js storage/emulated/legacy/katalkbot/Bots/lotto/index.js adb push env.js storage/emulated/legacy/katalkbot/global_modules/env.js adb push kaling.js storage/emulated/legacy/katalkbot/global_modules/kaling.js -adb push crypto.js storage/emulated/legacy/katalkbot/global_modules/crypto.js \ No newline at end of file +adb push crypto.js storage/emulated/legacy/katalkbot/global_modules/crypto.js +adb push kalink.js storage/emulated/legacy/katalkbot/global_modules/kalink.js \ No newline at end of file