文章詳情頁
python的 itchat微信api文檔的 itchat.send如何發(fā)信息給指定用戶?
瀏覽:198日期: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’’}}>
不能發(fā)給自己信息
itchat.send(’hello’,toUserName = User)
發(fā)給別人也不行( User 是一個微信號 )
問題解答
回答1:#想給誰發(fā)信息,先查找到這個朋友users = itchat.search_friends(name=u’通訊錄備注名’)#找到UserNameuserName = users[0][’UserName’]#然后給他發(fā)消息itchat.send(’hello’,toUserName = userName)
或者每直接用這個用戶發(fā)送
user = itchat.search_friends(name=u’通訊錄備注名’)[0]user.send(u’機(jī)器人say hello’)
相關(guān)文章:
1. docker不顯示端口映射呢?2. dockerfile - [docker build image失敗- npm install]3. docker gitlab 如何git clone?4. docker內(nèi)創(chuàng)建jenkins訪問另一個容器下的服務(wù)器問題5. vim - docker中新的ubuntu12.04鏡像,運(yùn)行vi提示,找不到命名.6. macos - mac下docker如何設(shè)置代理7. golang - 用IDE看docker源碼時的小問題8. dockerfile - 為什么docker容器啟動不了?9. angular.js使用$resource服務(wù)把數(shù)據(jù)存入mongodb的問題。10. docker容器呢SSH為什么連不通呢?
排行榜

熱門標(biāo)簽
網(wǎng)公網(wǎng)安備