From a3b0c2c9bba31dbaf50846338fd03e6269b71040 Mon Sep 17 00:00:00 2001 From: liaojack8 Date: Mon, 6 Jul 2020 21:18:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3tg=20bot=E6=8C=89=E9=88=95?= =?UTF-8?q?=E9=A1=AF=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/tg.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/tg.js b/src/tg.js index 2e50d09..613da69 100644 --- a/src/tg.js +++ b/src/tg.js @@ -98,7 +98,9 @@ function send_choice ({ fid, chat_id }) { reply_markup: { inline_keyboard: [ [ - { text: '文件統計', callback_data: `count ${fid}` }, + { text: '文件統計', callback_data: `count ${fid}` } + ], + [ { text: '開始複製', callback_data: `copy ${fid}` } ] ].concat(gen_bookmark_choices(fid)) @@ -111,9 +113,8 @@ function gen_bookmark_choices (fid) { const gen_choice = v => ({text: `複製到 ${v.alias}`, callback_data: `copy ${fid} ${v.alias}`}) const records = db.prepare('select * from bookmark').all() const result = [] - for (let i = 0; i < records.length; i += 2) { + for (let i = 0; i < records.length; i++) { const line = [gen_choice(records[i])] - if (records[i + 1]) line.push(gen_choice(records[i + 1])) result.push(line) } return result