#此程序需在有网络的条件下运行

import itchat
from itchat.content import *
import re

@itchat.msg_register([TEXT])
def text_reply(msg):
    print("..%s.."%msg['Text'])
    #span去除前后空格 再进行匹配
    match = re.search('',msg['Text']).span()
    if match:
        itchat.send('你也新年快乐啊~',msg['FromUserName'])
    else:
        print('haha')
#程序一运行,生成一个二维码,等待用户扫描
itchat.auto_login(enableCmdQR=True,hotReload=True)
itchat.run()

 

相关文章:

  • 2021-11-30
  • 2022-01-07
  • 2021-05-09
  • 2022-02-14
  • 2021-12-26
  • 2022-01-03
  • 2021-11-24
  • 2021-05-30
猜你喜欢
  • 2022-01-06
  • 2021-12-23
  • 2021-04-27
相关资源
相似解决方案