Python:监控微信群里的消息,并根据条件进行回复(发送图片)
生活随笔
收集整理的這篇文章主要介紹了
Python:监控微信群里的消息,并根据条件进行回复(发送图片)
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
import itchat@itchat.msg_register(itchat.content.TEXT, isGroupChat=True)
def text_reply(msg):if not msg['FromUserName'] == myUserName:#群名 發消息人 信息print(msg['User']['NickName'] + ' ' + msg['ActualNickName'] + ' ' + msg['Content'])if msg['User']['NickName'] == '測試群':itchat.send_image("C:\\a.png", 'filehelper')if __name__ == '__main__':itchat.auto_login()myUserName = itchat.get_friends(update=True)[0]["UserName"]itchat.run()print(myUserName)
?
總結
以上是生活随笔為你收集整理的Python:监控微信群里的消息,并根据条件进行回复(发送图片)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 百家姓拼音表
- 下一篇: PyQt5GUI快速编程学习