wechaty / wechaty-puppet-padplus

DEPRECATED: One puppet based on iPad protocal for Wechaty
https://wechaty.js.org/docs/puppet-services/
315 stars 65 forks source link

How to send official account contact card? #249

Open treeguard opened 4 years ago

treeguard commented 4 years ago

Is your feature request related to a problem? Please describe. I want to share the official account contact card to other people.

A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like A clear and concise description of what you want to happen. It seems I can't get official account from Contact.findAll also. It would be nice if we can get official account contacts and then can share it to other people.

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Additional context Add any other context or screenshots about the feature request here.

[enhancement]

su-chang commented 4 years ago

Just have a try:

const contact = message.from() 
const oa = bot.Contact.load('gh_xxx') // you should know the account for OA first
await contact.say(oa)
treeguard commented 4 years ago

@su-chang Thanks for the info, it works! However, it shows the id 'gh_xxx' on the card, is it able to remove it?

su-chang commented 4 years ago

If the OA has nickname, I think there will not show the origin id on the card.

BTW, could you please show the screenshot for it?

treeguard commented 4 years ago

sure. I think the issue is it can't recognize it's a official account card and still show "个人名片" instead it should show "公众号名片".

IMG_4888

I am testing with "gh_5315e0554556".

su-chang commented 4 years ago

Got it, you can regard it as a bug, we can not distinguish them now.

treeguard commented 4 years ago

Thanks for replying so quickly! Let me know if anything I can help