提交 ab049ec7 编写于 作者: Huan (李卓桓)'s avatar Huan (李卓桓)

await finis

上级 9b8ca5e7
......@@ -106,7 +106,7 @@ bot
bot.start()
.catch(e => {
log.error('Bot', 'init() fail: %s', e)
log.error('Bot', 'start() fail: %s', e)
bot.stop()
process.exit(-1)
})
......@@ -119,10 +119,11 @@ bot.on('error', async e => {
await bot.stop()
})
finis((code, signal) => {
finis(async (code, signal) => {
const exitMsg = `Wechaty exit ${code} because of ${signal} `
console.log(exitMsg)
if (bot.logonoff()) {
bot.say(exitMsg).catch(console.error)
await bot.say(exitMsg).catch(console.error)
}
process.exit(code)
})
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册