Open huan opened 2 years ago
@Huan (李卓桓) 李老师 我问下哈,Wechaty Contact 中的 Id 是 微信官方标识的唯一 ID 吗?还是说咱们将这个 ID 进行了一次封装呀
Contact 中的 Id 是否微信官方标识的唯一 ID
这个取决于底层的 Puppet Provider 实现。See: https://wechaty.js.org/docs/puppet-providers/
比如:
@huan 李老师,我问下哈。Wechaty MiniProgram 这个类有没有一个使用上的文档。我现在在使用这个类的时候是没有办法走通流程的,我是用的方式是参考 https://wechaty.js.org/docs/api/message/#example-5
@Xuancaosu The mini-program docs are very limited. The best way to learn it is by reading the source code.
Here are some related links:
@huan 李老师,我在使用,发送小程序链接的时。小程序链接可以正常发送出去,但是我在接收端,无法正常打开。请问是我使用的 Puppet 问题还是说我的调用方式问题。
Puppet:wechaty-puppet-padlocal
Code:
await message.say(
new MiniProgram({
appid: 'wxa0435021fd7xxxx',
username: 'gh_a781a79xxxx',
title: '小登录',
description: '小登录',
pagepath: 'routes/explore.html',
iconUrl: 'http://files.authing.co/authing-console/authing-console-logo.png',
thumbnailUrl: thumbnailUrl
})
)
建议使用以下方式,先获取对应小程序的参数(给bot发送一个你想要通过bot发送的小程序),校验无误后再进行发送。目前怀疑是参数不正确导致无法正常打开。
if (message.type() === MessageType.MiniProgram) {
const payload = await message.toMiniProgram()
console.log(JSON.stringify(payload))
}
Update Nov 2023:
Thanks, @willin, for all your previous work! We have the current resources available for future development based on the following:
Feature to be plugined:
Reference material (API docs, etc):
@leinue @wechaty/bot5