From e68b154ddc519b94e1c74e6f18a6de40616e2af8 Mon Sep 17 00:00:00 2001 From: hibiki <775757368@qq.com> Date: Wed, 11 Aug 2021 10:41:40 +0800 Subject: [PATCH] fix yiqing --- plugins/update_setu/data_source.py | 2 +- plugins/yiqing/data_source.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/plugins/update_setu/data_source.py b/plugins/update_setu/data_source.py index 67f82f0f..4cceb2a1 100644 --- a/plugins/update_setu/data_source.py +++ b/plugins/update_setu/data_source.py @@ -158,7 +158,7 @@ async def update_setu_img(): error_info = ['无报错..'] if not error_info else error_info await get_bot().send_private_msg( user_id=int(list(get_bot().config.superusers)[0]), - message=f'{str(datetime.now()).split(".")[0]} 更新 色图 完成,本地群在 {count} 张,实际更新 {_success} 张,以下为更新时未知错误:\n' + message=f'{str(datetime.now()).split(".")[0]} 更新 色图 完成,本地存在 {count} 张,实际更新 {_success} 张,以下为更新时未知错误:\n' + "\n".join(error_info), ) diff --git a/plugins/yiqing/data_source.py b/plugins/yiqing/data_source.py index 2274e512..9f0b6ef2 100644 --- a/plugins/yiqing/data_source.py +++ b/plugins/yiqing/data_source.py @@ -25,12 +25,13 @@ async def get_yiqing_data(area: str): if area == '中国': province = area province_type = "" - elif area[-1] != '省': + elif area[-1] == '市' and area not in data.keys(): + area = area[:-1] if area[-1] == '市' else area for p in data.keys(): if area in data[p]: province = p city = area - elif area in data.keys() or area[:-1] in data.keys(): + elif area in data.keys(): province = area if area[-1] != '省' else area[:-1] if len(data[province]) == 1: province_type = "市"