0 Posted 2020-01-22Updated 2024-01-11Pythona minute read (About 137 words)itchat | Log and boot your wechat with pythonwechat bot微信机器人 确保你可以正常登录网页版微信 import itchat## 登录itchat.login()itchat.auto_login(enableCmdQR=True)itchat.auto_login(hotReload=True)## 发送消息itchat.send(u'你好', 'filehelper')## 联系人列表F_list = itchat.get_friends(update=True)##找到发信息的IDfor i in F_list: if i['RemarkName'] == 'XXX': #昵称 print(i['UserName'])## friendsfriends = itchat.get_friends(update=True)[0:]## aotu-returnimport itchat##自动回复@itchat.msg_register(itchat.content.TEXT)def text_reply(msg): return "本人已死,有事招魂,没事烧纸 ಠಗಠ"#+msg["Text"]##登入itchat.auto_login()##保持运行itchat.run() itchat | Log and boot your wechat with pythonhttps://karobben.github.io/2020/01/22/Python/itchat/AuthorKarobbenPosted on2020-01-22Updated on2024-01-11Licensed under#PythonHTML