How does itchat.send of python's itchat WeChat api document send information to a specified user?
为情所困
为情所困 2017-06-12 09:25:00
0
1
1776
itchat.send_msg('Hello world')
<ItchatReturnValue: {u'MsgID': u'', u'LocalID': u'', u'BaseResponse': {u'ErrMsg': u'', u'Ret': 1204, 'RawMsg': u''}}>

Cannot send messages to myself

itchat.send('hello',toUserName = User)

You can’t send it to others either (User is a WeChat account )

为情所困
为情所困

reply all(1)
仅有的幸福
#想给谁发信息,先查找到这个朋友
users = itchat.search_friends(name=u'通讯录备注名')
#找到UserName
userName = users[0]['UserName']
#然后给他发消息
itchat.send('hello',toUserName = userName)

Or send directly with this user

user = itchat.search_friends(name=u'通讯录备注名')[0]
user.send(u'机器人say hello')
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!