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

请问自定义收发个人名片这块好实现么 #2

Closed
JingRen790838213 opened this issue Jan 6, 2023 · 8 comments
Closed

请问自定义收发个人名片这块好实现么 #2

JingRen790838213 opened this issue Jan 6, 2023 · 8 comments

Comments

@JingRen790838213
Copy link

请问自定义收发个人名片这块好实现么

@xcosmosbox
Copy link
Owner

请问自定义收发个人名片这块好实现么

好实现,本项目所依赖的wechaty包中存在 Message.Contact 类,可以轻松实现收发个人名片。不论是人与人之间的还是聊天小组的。如果是个人可以设置为只要有新好友或者触发某种关键词就转发个人名片。

@JingRen790838213
Copy link
Author

请问自定义收发个人名片这块好实现么

好实现,本项目所依赖的wechaty包中存在 Message.Contact 类,可以轻松实现收发个人名片。不论是人与人之间的还是聊天小组的。如果是个人可以设置为只要有新好友或者触发某种关键词就转发个人名片。

能说具体点么,
我看源码里面有这么一句
msgId = await puppet.messageSendContact(conversationId, sayable.id),
是要diy一个provider才可以么,但diy provider文档内容好少,不知道如何下手

@xcosmosbox
Copy link
Owner

请问自定义收发个人名片这块好实现么

好实现,本项目所依赖的wechaty包中存在 Message.Contact 类,可以轻松实现收发个人名片。不论是人与人之间的还是聊天小组的。如果是个人可以设置为只要有新好友或者触发某种关键词就转发个人名片。

能说具体点么, 我看源码里面有这么一句 msgId = await puppet.messageSendContact(conversationId, sayable.id), 是要diy一个provider才可以么,但diy provider文档内容好少,不知道如何下手

不需要diy,只需要通过获取(或者提前配置好)你想要发送的个人名片(不论是自己的还是别人的)。
通过 bot.Contact.find({name: '联系人名字'}) 就能找到个人名片。然后使用 say 函数发送就行。
这是我找到的官方文档给的例子:
image
更多内容你可以看看这个文档:https://wechaty.gitbook.io/wechaty/api/message#Message

@xcosmosbox xcosmosbox reopened this Jan 7, 2023
@JingRen790838213
Copy link
Author

请问自定义收发个人名片这块好实现么

好实现,本项目所依赖的wechaty包中存在 Message.Contact 类,可以轻松实现收发个人名片。不论是人与人之间的还是聊天小组的。如果是个人可以设置为只要有新好友或者触发某种关键词就转发个人名片。

能说具体点么, 我看源码里面有这么一句 msgId = await puppet.messageSendContact(conversationId, sayable.id), 是要diy一个provider才可以么,但diy provider文档内容好少,不知道如何下手

不需要diy,只需要通过获取(或者提前配置好)你想要发送的个人名片(不论是自己的还是别人的)。 通过 bot.Contact.find({name: '联系人名字'}) 就能找到个人名片。然后使用 say 函数发送就行。 这是我找到的官方文档给的例子: image 更多内容你可以看看这个文档:https://wechaty.gitbook.io/wechaty/api/message#Message

这个功能早不支持了,都收费了

@xcosmosbox
Copy link
Owner

请问自定义收发个人名片这块好实现么

好实现,本项目所依赖的wechaty包中存在 Message.Contact 类,可以轻松实现收发个人名片。不论是人与人之间的还是聊天小组的。如果是个人可以设置为只要有新好友或者触发某种关键词就转发个人名片。

能说具体点么, 我看源码里面有这么一句 msgId = await puppet.messageSendContact(conversationId, sayable.id), 是要diy一个provider才可以么,但diy provider文档内容好少,不知道如何下手

不需要diy,只需要通过获取(或者提前配置好)你想要发送的个人名片(不论是自己的还是别人的)。 通过 bot.Contact.find({name: '联系人名字'}) 就能找到个人名片。然后使用 say 函数发送就行。 这是我找到的官方文档给的例子: image 更多内容你可以看看这个文档:https://wechaty.gitbook.io/wechaty/api/message#Message

这个功能早不支持了,都收费了

我看了下我自己写的代码,message.talker()可以获得Contact对象,你可以找找talker这个function现在有没有变成别的。

@JingRen790838213
Copy link
Author

contactCard可以拿到,貌似是msg.say()这块已经不能传卡片了,用他们的provider,那些token还是挺贵的

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

3 participants
@JingRen790838213 @xcosmosbox and others