Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

为什么我weixin: ''这块有时候能获取,有时候获取不到呢,这个id并不是真实id,或者告诉我这两个的关联方式 #2689

Open
aqpmzngldh opened this issue May 10, 2024 · 2 comments

Comments

@aqpmzngldh
Copy link

WechatifiedContactImpl {
_events: [Object: null prototype] {},
_eventsCount: 0,
_maxListeners: undefined,
id: 'wxid_o42elvr0ggen22',
payload: {
alias: '',
avatar: 'https://wx.qlogo.cn/mmhead/ver_1/UeYTB2Tcgic1r8Qxd4NhSc0TYxS4jicAI94liclkrETqqFJNB8swq64KblXTBcvIgvScXNbrnibNCiaLaicEbGpeHJMvibpwtkZxjwqb4ibkjopXolFXVD0bpduzeluECmsLjYBP/0',
city: '',
friend: false,
gender: 0,
id: 'wxid_o42elvr0ggen22',
name: '千夜',
phone: [],
province: '',
signature: '',
type: 1,
weixin: ''
},
[Symbol(kCapture)]: false
}

Copy link

dosubot bot commented May 10, 2024

The inconsistency in retrieving the weixin field from the WechatifiedContactImpl object is likely due to limitations in the Wechaty Puppet implementation or restrictions from the WeChat platform itself. The weixin field, intended to return a Weixin ID, and the id field, which is a unique identifier used by Wechaty and its underlying puppet, serve different purposes. The availability of the weixin field can be affected by the specific puppet's capabilities and the permissions granted to your bot by WeChat.

It's recommended to transition to using the handle() method instead of directly accessing the weixin field, although this does not guarantee the field's availability in every case. This issue arises from the puppet implementation or WeChat platform limitations, not from your code's logic.

For detailed implementation and to understand how WechatifiedContactImpl works, you might want to look into the Wechaty source code, specifically around the contact management sections.

Details

Sources


About Dosu
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

To continue the conversation, mention @dosu.

@aqpmzngldh
Copy link
Author

已解决

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant