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

try selfId

上级 e39fc312
......@@ -300,17 +300,21 @@ export class Io {
case 'update':
log.verbose('Io', 'on(update): %s', ioEvent.payload)
const userId = this.options.wechaty.puppet.selfId()
if (userId) {
const loginEvent: IoEvent = {
name : 'login',
payload : {
id: userId,
name: this.options.wechaty.Contact.load(userId).name(),
},
try {
const userId = this.options.wechaty.puppet.selfId()
if (userId) {
const loginEvent: IoEvent = {
name : 'login',
payload : {
id: userId,
name: this.options.wechaty.Contact.load(userId).name(),
},
}
await this.send(loginEvent)
}
await this.send(loginEvent)
} catch (e) {
// not login
}
if (this.scanPayload) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册