update readme, and fix auto install sctript.

This commit is contained in:
liaojack8 committed 2020-07-05 13:20:12 +08:00
1 parent 5f424722f7
commit 85ccba7c72
10 files changed
+60 -266

No files matched your search

+8 -3
View File
@@ -64,8 +64,13 @@ router.post('/api/gdurl/tgbot', async ctx => {
tg_copy({ fid, chat_id }).then(task_id => {
task_id && sm({ chat_id, text: `開始複製,任務ID: ${task_id} 可輸入 /task ${task_id} 查詢進度` })
})
} else if (action === 'disCopy') {
const target = '11231' //儲存目的地2
} else if (action === 'copy2') {
const target = ''
tg_copy({ fid, target, chat_id }).then(task_id => {
task_id && sm({ chat_id, text: `開始複製,任務ID: ${task_id} 可輸入 /task ${task_id} 查詢進度` })
})
} else if (action === 'copy3') {
const target = ''
tg_copy({ fid, target, chat_id }).then(task_id => {
task_id && sm({ chat_id, text: `開始複製,任務ID: ${task_id} 可輸入 /task ${task_id} 查詢進度` })
})
@@ -117,7 +122,7 @@ router.post('/api/gdurl/tgbot', async ctx => {
task_id = parseInt(task_id)
if (!task_id) {
const running_tasks = db.prepare('select id from task where status=?').all('copying')
if (!running_tasks.length) return sm({ chat_id, text: '当前暂无运行中的任务' })
if (!running_tasks.length) return sm({ chat_id, text: '目前沒有執行中的任務' })
return running_tasks.forEach(v => send_task_info({ chat_id, task_id: v.id }).catch(console.error))
}
send_task_info({ task_id, chat_id }).catch(console.error)
+8 -2
View File
@@ -50,8 +50,13 @@ function send_choice ({ fid, chat_id }) {
{ text: '文件統計', callback_data: `count ${fid}` }
],
[
{ text: '開始複製(預設)', callback_data: `copy ${fid}` },
{ text: '開始複製(discord)', callback_data: `disCopy ${fid}` }
{ text: '開始複製(預設)', callback_data: `copy ${fid}` }
],
[
{ text: '開始複製(1)', callback_data: `copy2 ${fid}` }
],
[
{ text: '開始複製(2)', callback_data: `copy3 ${fid}` }
]
]
}
@@ -169,6 +174,7 @@ async function tg_copy ({ fid, target, chat_id, update }) { // return task_id
text += '源資料夾:' + gen_link(source, name) + '\n'
text += '目錄完成數:' + copied_folders + '/' + folder_count + '\n'
text += '文件完成數:' + copied_files + '/' + file_count + '\n'
text += '合計大小:' + (total_size || '未知大小') + '\n'
sm({ chat_id, text, parse_mode: 'HTML' })
})
.catch(err => {