文章詳情頁
python的 itchat微信api文檔的 itchat.send如何發信息給指定用戶?
瀏覽:112日期: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. javascript - 怎么下載vue csp版本的2.0或者以上?2. mysql如何配置遠程php外網鏈接數據庫3. io - java 文件操作,如何向指定的位置插入內容 (不是替換內容) ?4. javascript - vue使用videojs+videojs-contrib-hls報錯5. 關docker hub上有些鏡像的tag被標記““This image has vulnerabilities””6. dockerfile - [docker build image失敗- npm install]7. Python 爬蟲 遇到的問題(手淘問大家)8. golang - 用IDE看docker源碼時的小問題9. docker - 各位電腦上有多少個容器???容器一多,自己都搞混了,咋辦呢?10. javascript - 求救!網頁播放視頻只有聲音沒有畫面,網頁上傳視頻文件時怎么知道視頻的編碼為H264還是MPEG4??
排行榜
