add fan page notify, add twitch route, todo: twitch webhook reg
This commit is contained in:
+17
-14
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user