def text_reply(msg): match = re.search(u'?', msg['Text']).span() if match: itchat.send((u'??????????'), msg['FromUserName'])