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

code clean

上级 43c76bed
......@@ -17,10 +17,6 @@
* limitations under the License.
*
*/
/* tslint:disable:variable-name */
import { generate } from 'qrcode-terminal'
import {
IoClient,
Wechaty,
......@@ -28,6 +24,9 @@ import {
log,
} from '../src/'
import { generate } from 'qrcode-terminal'
console.log(`
=============== Powered by Wechaty ===============
-------- https://github.com/Chatie/wechaty --------
......@@ -74,7 +73,7 @@ bot
.on('logout' , user => log.info('Bot', `${user.name()} logouted`))
.on('error' , e => log.info('Bot', 'error: %s', e))
.on('login', async function(this, user) {
.on('login', async function(user) {
const msg = `${user.name()} logined`
log.info('Bot', msg)
......
......@@ -251,14 +251,18 @@ export class PuppetPadchat extends Puppet {
log.verbose('PuppetPadchat', 'reset(%s)', reason)
try {
log.silly('PuppetPadchat', 'reset() before stop')
await this.stop()
log.silly('PuppetPadchat', 'reset() after stop')
await this.start()
log.silly('PuppetPadchat', 'reset() after start')
} catch (e) {
log.error('PuppetPadchat', 'reset() exception: %s', e.message)
this.emit('error', e)
throw e
}
log.silly('PuppetPadchat', 'reset() done')
}
protected async onPadchatMessage(rawPayload: PadchatMessagePayload): Promise<void> {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册