gt;
<sourceusername></sourceusername>
<sourcedisplayname></sourcedisplayname>
<commenturl></commenturl>
<thumburl>
http://imgcache.qq.com/music/photo/album/63/180_albumpic_143163_0.jpg
</thumburl>
<md5></md5>
</appmsg>
<fromusername></fromusername>
<scene>0</scene>
<appinfo>
<version>29</version>
<appname>摇一摇搜歌</appname>
</appinfo>
<commenturl></commenturl>
</msg>
群消息
itchat 增加了三个群聊相关的键值:
- isAt : 判断是否 @ 本号
- ActualNickName : 实际 NickName
- Content : 实际 Content
MsgType: 1
FromUserName: @@xxx
ToUserName: @xxx
Content:
@xxx:<br/>xxx
红包消息
MsgType: 49
AppMsgType: 2001
FromUserName: 发送方ID
ToUserName: 接收方ID
Content: 未知
系统消息
MsgType: 10000
FromUserName: 发送方ID
ToUserName: 自己ID
Content:
"你已添加了 xxx ,现在可以开始聊天了。"
"如果陌生人主动添加你为朋友,请谨慎核实对方身份。"
"收到红包,请在手机上查看"
tchat 为三种账号都提供了整体获取方法与搜索方法.
好友
get_friends
- itchat.get_friends() 返回完整的好友列表
- 每个好友为一个字典, 其中第一项为本人的账号信息;
- 传入 update=True, 将更新好友列表并返回, get_friends(update=True)
search_friends
- itchat.get_friends() 好友搜索,有以下四种方式
- 仅获取自己的用户信息
# 获取自己的用户信息,返回自己的属性字典
itchat.search_friends()
# 获取特定UserName的用户信息
itchat.search_friends(userName='@abcdefg1234567')
## 获取发送信息的好友的详细信息
@itchat.msg_register(itchat.content.TEXT,isFriendChat=True)
def reply(msg):
&