文章详情页
python的 itchat微信api文档的 itchat.send如何发信息给指定用户?
浏览:203日期:2022-06-29 11:06:53
问题描述
itchat.send_msg(’Hello world’)<ItchatReturnValue: {u’MsgID’: u’’, u’LocalID’: u’’, u’BaseResponse’: {u’ErrMsg’: u’’, u’Ret’: 1204, ’RawMsg’: u’’}}>
不能发给自己信息
itchat.send(’hello’,toUserName = User)
发给别人也不行( User 是一个微信号 )
问题解答
回答1:#想给谁发信息,先查找到这个朋友users = itchat.search_friends(name=u’通讯录备注名’)#找到UserNameuserName = users[0][’UserName’]#然后给他发消息itchat.send(’hello’,toUserName = userName)
或者每直接用这个用户发送
user = itchat.search_friends(name=u’通讯录备注名’)[0]user.send(u’机器人say hello’)
相关文章:
1. css - 文字排版问题,内容都是动态抓出来的,字数不一定。如何对齐啊2. javascript - Ajax返回json格式之后的数据解析后取出来的数据为undefined?3. git - 在web应用分布式部署的情况下怎么进行配置更新4. css3 - 微信前端页面遇到的transition过渡动画的bug5. 前端 - WebStrom安装了angularjs插件,但是没有语法提示6. 网页爬虫 - 关于Python的编码与解码问题7. 微信开放平台 - ios APP能不能打开微信然后通过微信跳转到指定的URL?8. selenium-selenium-webdriver - python 将当前目录加入到 环境变量9. javascript - imgzoom插件所引发的bug血案!!!!10. php ZipArchive关于不同目录文件压缩
排行榜

网公网安备