We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
测试结果文档链接(待补充):https://k0auuqcihb.feishu.cn/wiki/wikcnVwzIb24hmiW6upptq6Sfsw
目前观察发现 WhatsApp Web 端在手机离线的情况下接收到的消息都会同步成功。
whatsapp-web.js 的 SDK 中提供接口 fetchMessage(),参见:https://docs.wwebjs.dev/Chat.html#fetchMessages
whatsapp-web.js
fetchMessage()
考虑在 puppet-whatsapp 中触发 READY 事件前,针对当前所有会话拉取近期的消息:
puppet-whatsapp
READY
该消息已经存在缓存中
忽略该消息
该消息不存在缓存中
推送该消息至 Wechaty 端
Wechaty
The text was updated successfully, but these errors were encountered:
目前仅在触发ready事件之前才会同步消息。
可能还需要加一个定时任务来定时拉取近期的消息,以便及时同步丢失的消息。
Sorry, something went wrong.
待优化
接口 fetchMessage()只支持 limit 参数,导致每次同步消息时都会拉取所有会话的所有消息。
limit
目前的优化方案只是根据 timestamp 属性来判断是否进行执行 onMessage 函数。
timestamp
onMessage
最好是 whatsapp-web.js 能支持以 timestamp 为参数来调用 fetchMessage() 接口。
针对历史消息需要增加最小时长,来控制向 Wechaty emit 消息的数量,暂定 3 天。
We should always put the public link in the issue, or this issue will be meaningless.
su-chang
No branches or pull requests
测试结果文档链接(待补充):https://k0auuqcihb.feishu.cn/wiki/wikcnVwzIb24hmiW6upptq6Sfsw
解决方案
目前观察发现 WhatsApp Web 端在手机离线的情况下接收到的消息都会同步成功。
whatsapp-web.js
的 SDK 中提供接口fetchMessage()
,参见:https://docs.wwebjs.dev/Chat.html#fetchMessages考虑在
puppet-whatsapp
中触发READY
事件前,针对当前所有会话拉取近期的消息:该消息已经存在缓存中
忽略该消息
该消息不存在缓存中
推送该消息至
Wechaty
端The text was updated successfully, but these errors were encountered: