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

code clean

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