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

try selfId

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