def check_info(field, bot, group_name): """ 根据传入的字段进行信息校验,并发送信息 :param field: :return: """ send_group_message(bot, group_name, '识别的{}为:'.format(field) + invoice_data[field]) if invoice_data[field] == correct_info[field]: send_group_message(bot, group_name, '{}正确'.format(field)) else: send_group_message(bot, group_name, '{}错误!!'.format(field)) send_group_message(bot, group_name, '正确的{}为:'.format(field) + correct_info[field])
from bot_wechat_invoice import send_group_message from baidu_ai import get_commodity_data from question_dict import question_dict from wxpy import * import time correct_info = {'购方名称': '甘肃省水利水电勘测设计研究院', '购方纳税人识别号': '620102438002318'} bot = Bot() # 实例化机器人对象 group_name = '6666' # # 在win系统第一次运行时,在该系统没有保存该群聊信息,需要首先发送一条信息 # print('请在目标群聊中输入一句话唤醒微信机器人') # content = input() send_group_message(bot, group_name, '6666~~') invoice_data_list = [] # 存储识别后的发票信息的列表 print('****************adding from yellowlmf****************') def check_info(field, bot, group_name): """ 根据传入的字段进行信息校验,并发送信息 :param field: :return: """ send_group_message(bot, group_name, '识别的{}为:'.format(field) + invoice_data[field]) if invoice_data[field] == correct_info[field]: send_group_message(bot, group_name, '{}正确'.format(field))