Skip to content

Commit

Permalink
feat: 尝试重启
Browse files Browse the repository at this point in the history
  • Loading branch information
IITII committed Dec 18, 2023
1 parent 7a8d88e commit 45f916b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions App.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ async function resetBotCommand(bot) {
{command: 'download', description: '仅下载'},
{command: 'sub', description: '订阅'},
{command: 'u_sub', description: '取消订阅'},
{command: 'exit', description: '尝试重启'},
{command: 'run', description: '立即扫描'},
]
await bot.telegram.deleteMyCommands()
Expand Down
8 changes: 8 additions & 0 deletions bot_command.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const commands = [
['/u_sub', start_end_sub,],
['/search', search,],
['/run', TaskRunner.run,],
['/exit', exit,],
]
const actions = [
// ...img_or_tags_arr.map(([_, ac]) => [ac, action_img_or_tags]),
Expand Down Expand Up @@ -171,6 +172,13 @@ async function start_end_sub(ctx) {
return ctx.reply(msg)
}

function exit(ctx) {
setTimeout(() => {
process.exit(0)
}, 2000)
return ctx.reply(`尝试重启...`)
}

const subMap = new Map()
async function end_sub(ctx) {
ctx = sub_init(ctx)
Expand Down

0 comments on commit 45f916b

Please sign in to comment.