import itchat from itchat.content import * # 微信自動回覆 @itchat.msg_register([TEXT]) def text_reply(msg): print(msg) text = msg['Text'] print(text) to_user = msg["ToUserName"] if "年" in text: itchat.send("謝謝你的祝福,我祝你來年賺大錢,迎娶白富美,走上人生巔峯", to_user) # 等待 掃描二維碼 不須要第二次掃描 itchat.auto_login(hotReload=True) # 等到回覆 itchat.run() # zb983978082 # 練習:微信自動回覆, 本身給本身發微信,而後本身回覆本身