7.1.1 好友消息
FriendMessage
支持属性
属性名
类型
说明
type
str
消息类型,固定为friend
content
str
消息内容
sender
str
发送者
sender_remark
str
发送者备注名
info
list
原始消息信息,包含了消息的所有信息
control
uiautomation.Control
该消息的uiautomation控件
id
str
消息id
支持方法
引用消息quote
方法
quote
方法参数:
参数
类型
默认值
说明
msg
str
/
要回复的消息内容
示例:
返回值:无
转发消息forward
方法
forward
方法参数:
参数
类型
默认值
说明
friend
str
/
要转发给谁,昵称、备注、微信号都可以,手机号不可以
示例:
返回值(bool):
返回值为bool格式,是否转发成功
解析合并消息parse
方法
parse
方法参数:无
示例:
返回值(List[List[str]]):
返回值为list,list中元素为包含消息详情的list,消息详情有三个:消息发送者昵称、消息内容、时间
获取发送者信息sender_info
方法
sender_info
方法参数:无
示例:
返回值(Dict[str, str]):
返回值为一个dict,包含了发送人的基本信息,例如:
添加发送人为好友add_friend
方法
add_friend
方法参数:
参数
类型
默认值
说明
addmsg
str
None
添加好友的消息
remark
str
None
备注名
tags
list
None
标签列表
permission
str
'朋友圈'
朋友圈权限, 可选值:'朋友圈', '仅聊天'
示例:
返回值(int):
0 - 添加失败
1 - 发送请求成功
2 - 已经是好友
3 - 对方不允许通过群聊添加好友
拍一拍tickle
方法
tickle
方法参数:无
示例:
返回值:无
点击click
方法
click
方法参数:无
示例:
最后更新于
这有帮助吗?