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

code clean

上级 f8a7c715
......@@ -149,10 +149,10 @@ export class IoClient {
// , m.toStringDigest()
// )
if (/^wechaty|chatie|botie/i.test(m.text()) && !m.self()) {
await m.say('https://www.chatie.io')
.then(_ => log.info('Bot', 'REPLIED to magic word "chatie"'))
}
// if (/^wechaty|chatie|botie/i.test(m.text()) && !m.self()) {
// await m.say('https://www.chatie.io')
// .then(_ => log.info('Bot', 'REPLIED to magic word "chatie"'))
// }
}
public async stop(): Promise<void> {
......
......@@ -248,10 +248,16 @@ export class PuppetPadchat extends Puppet {
}
protected async reset(reason: string): Promise<void> {
log.verbose('PuppetPadchat', 'restart(%s)', reason)
log.verbose('PuppetPadchat', 'reset(%s)', reason)
await this.stop()
await this.start()
try {
await this.stop()
await this.start()
} catch (e) {
log.error('PuppetPadchat', 'reset() exception: %s', e.message)
this.emit('error', e)
throw e
}
}
......
......@@ -39,7 +39,7 @@ export function contactRawPayloadParser(
* user_name: '' }
*/
// console.log(rawPayload)
throw Error('cannot get user_name for payload: ' + JSON.stringify(rawPayload))
throw Error('cannot get user_name from raw payload: ' + JSON.stringify(rawPayload))
}
if (isRoomId(rawPayload.user_name)) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册