2019102152 김다빈

Modify trading_notice target

Showing 1 changed file with 3 additions and 4 deletions
......@@ -12,6 +12,7 @@ const HTTPS = require('https');
const domain = "2019102152.osschatbot.ga"
const sslport = 23023;
const TARGET_URL = 'https://api.line.me/v2/bot/message/reply'
const BROAD_TARGET_URL = 'https://api.line.me/v2/bot/message/broadcast'
const bodyParser = require('body-parser');
const crypto = require('crypto');
const queryEncode = require('querystring').encode;
......@@ -430,16 +431,14 @@ function trading_notice(side, price, funds, volume,yield_data=0,market="") {
messages.push({ "type": "text", "text": "매도 주문이 체결되었습니다." });
messages.push({ "type": "text", "text": `${market}\n체결 금액 : ${funds}원\n체결 수량 : ${volume}개\n체결 평균가 : ${price}원\n수익률 : ${yield_data}%` });
}
var TARGET_URL = 'https://api.line.me/v2/bot/message/push';
request.post(
{
url: TARGET_URL,
url: BROAD_TARGET_URL,
headers: {
'Authorization': `Bearer ${TOKEN}`
},
json: {
"to": `${userid}`,
"messages": messages
}
}, (error, response, body) => {
......