add youtube new video notify

This commit is contained in:
Jay
2018-07-10 23:48:26 +08:00
parent fe018cf9e7
commit 5ed1e462b3
7 changed files with 98 additions and 12 deletions
+5 -1
View File
@@ -404,7 +404,9 @@ const addYoutube = async (txt = '', source = {}, db) => {
return { reply }
}
console.log('youtube id ::: ', id)
let youtubeName = await api.google.queryYoutubeName(id)
console.log('youtubr name :::: ', youtubeName)
if (youtubeName === null) return null
text = `select "id" from "public"."youtube_channel" where "id" = $1`
@@ -436,7 +438,9 @@ const addYoutube = async (txt = '', source = {}, db) => {
try {
await api.google.subYoutube(id)
} catch (err) {}
} catch (err) {
console.log(err)
}
return {
reply: 'add youtube channel success'
+1 -1
View File
@@ -27,7 +27,7 @@ const runAct = async (cmd, txt = '', source = {}) => {
if (!cmd || typeof cmd !== 'string' || cmd.length === 0) return null
if (!(cmd in cmds)) return null
let result = await cmds[cmd](txt, source)
return result
return result.reply
}
module.exports = runAct