def handle_msg_all(self, msg): print('..', sys._getframe().f_code.co_name) print('msg=', msg) username = msg['user']['name'] print(username) info = msg['content']['data'] if msg['msg_type_id'] == 4: # 普通信息 res_json = getTulingResp(info) print(type(res_json)) res = json.loads(res_json) print(res) text = res['text'] print(text) uid = Wechat.get_user_id(self, username) Wechat.send_msg_by_uid(self, text, uid) elif msg['msg_type_id'] == 37: # 添加好友请求 print(info) Wechat.apply_useradd_requests(self, info)