Update tg.js

This commit is contained in:
jkliao.tw 2020-07-07 12:17:18 +08:00 committed by GitHub
parent 53e6f75f1b
commit 371b4d6a57
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 0 additions and 2 deletions

View File

@ -133,7 +133,6 @@ function gen_bookmark_choices (fid) {
} }
const gen_choice = v => ({text: `複製到 ${v.alias}`, callback_data: `copy ${fid} ${v.alias}`}) const gen_choice = v => ({text: `複製到 ${v.alias}`, callback_data: `copy ${fid} ${v.alias}`})
const records = db.prepare('select * from bookmark').all() const records = db.prepare('select * from bookmark').all()
db.close()
const result = [] const result = []
for (let i = 0; i < records.length; i++) { for (let i = 0; i < records.length; i++) {
const line = [gen_choice(records[i])] const line = [gen_choice(records[i])]
@ -252,7 +251,6 @@ async function tg_copy ({ fid, target, chat_id, update }) { // return task_id
const task_id = record && record.id const task_id = record && record.id
if (task_id){ if (task_id){
db.prepare('update task set status=? where id=?').run('error', task_id) db.prepare('update task set status=? where id=?').run('error', task_id)
db.close()
} }
if (!record) record = {} if (!record) record = {}
console.error('複製失敗', fid, '-->', target) console.error('複製失敗', fid, '-->', target)