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

FriendShip中,支持通过好友。但是FriendshipPayload中的信息却无法获取到。设置为private。请问有什么方式可以获取么 #65

Open
Seven-Y opened this issue Jul 19, 2020 · 7 comments

Comments

@Seven-Y
Copy link

Seven-Y commented Jul 19, 2020

private final var payload: io.github.wechaty.schemas.FriendshipPayload? /* compiled code */

这一块如果没办法获取到。应该以何种方式获取到申请通过好友的信息呢。且,如果要获取到申请通过好友的信息的来源,这又重哪里获取呢

@diaozxin007
Copy link
Collaborator

friendship.contact()

@Seven-Y
Copy link
Author

Seven-Y commented Jul 19, 2020

@diaozxin007 这个方法内的信息并不够哦。比如说,我需要获取到,这个用户是通过何种渠道添加机器人的。比如,名片分享【谁分享的】,二维码扫码加入的。这个信息都是没办法获取到的。只能 根据消息ID到message里获取到对应的信息进行解析处理

@diaozxin007
Copy link
Collaborator

可以提供操作的代码 demo,我看看能不能封装一个方法。如果可以你可以自己实现然后给我们提一个 PR。

@Seven-Y
Copy link
Author

Seven-Y commented Jul 20, 2020

OK。目前的解决方案为,把源文件的private 修改为public,而后重新编译。由于不熟悉kotlin语言,便不提交PR。等待组织后续更新后处理。

@diaozxin007
Copy link
Collaborator

需要读取的是哪个字段?

@Seven-Y
Copy link
Author

Seven-Y commented Jul 20, 2020

io.github.wechaty.user.Friendship.id
io.github.wechaty.user.Friendship.payload

需要获取该请求的消息ID,以便到onMessage方法中获取记录,进行解析获取更多的添加信息。比如来源。

@Seven-Y Seven-Y closed this as completed Jul 20, 2020
@diaozxin007 diaozxin007 reopened this Jul 24, 2020
@diaozxin007 diaozxin007 mentioned this issue Jul 24, 2020
@suruozhong
Copy link

反射可以获取一切

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