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

code clean

上级 bea36ebe
......@@ -99,6 +99,7 @@ bot
}
} catch (e) {
log.error('Bot', 'on(message) exception: %s' , e)
console.error(e)
}
})
......
......@@ -83,8 +83,8 @@ export abstract class Contact extends PuppetAccessory implements Sayable {
* @private
*/
public toString(): string {
const text = this.alias() || this.name() || this.id
return `Contact<${text}>`
const identity = this.alias() || this.name() || this.id
return `Contact<${identity}>`
}
/**
......
......@@ -156,11 +156,11 @@ export class Wechaty extends PuppetAccessory implements Sayable {
options.puppet = options.puppet || config.puppet
const name = options.profile === null
options.profile = options.profile === null
? null
: options.profile || config.default.DEFAULT_PROFILE
: (options.profile || config.default.DEFAULT_PROFILE)
this.profile = new Profile(name)
this.profile = new Profile(options.profile)
this.cuid = cuid()
}
......@@ -375,7 +375,7 @@ export class Wechaty extends PuppetAccessory implements Sayable {
puppet = new PUPPET_DICT[this.options.puppet]({
profile: this.profile,
wechaty: this,
})
}) as Puppet
} else if (this.options.puppet instanceof Puppet) {
puppet = this.options.puppet
} else {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册