add fan page notify, add twitch route, todo: twitch webhook reg

This commit is contained in:
Jay
2018-06-27 00:59:53 +08:00
parent f409e6ff61
commit 1f3057df69
15 changed files with 377 additions and 51 deletions
+17 -14
View File
@@ -1,5 +1,6 @@
const axios = require('axios')
const config = require('../../config')
const DB = require('../database')
const client = axios.create({
baseURL: 'https://api.line.me/v2/bot',
@@ -39,22 +40,24 @@ const textMessage = async (evt) => {
if (typeof text !== 'string') return
text = text.trim()
if (text.length === 0) return
let db = await DB.connect()
let opts = {
method: 'post',
url: replyURL,
data: {
replyToken,
messages: [
{
type: 'text',
text: 'test message'
}
]
}
}
// let opts = {
// method: 'post',
// url: replyURL,
// data: {
// replyToken,
// messages: [
// {
// type: 'text',
// text: 'test message'
// }
// ]
// }
// }
await client(opts)
// await client(opts)
db.release()
}
module.exports = {