From 14a4fceb29db8a902473b48c737d53ce56f5556e Mon Sep 17 00:00:00 2001 From: CMHopeSunshine <277073121@qq.com> Date: Sun, 18 Sep 2022 22:51:18 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20=E4=BF=AE=E5=A4=8D`=E6=9D=90=E6=96=99?= =?UTF-8?q?=E5=9C=B0=E5=9B=BE`=EF=BC=8C=E5=A2=9E=E5=8A=A0=E6=9D=90?= =?UTF-8?q?=E6=96=99=E6=95=B0=E5=8D=95=E6=AC=A1=E4=B8=8A=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LittlePaimon/plugins/Paimon_Wiki/__init__.py | 2 ++ LittlePaimon/plugins/Paimon_Wiki/draw_map.py | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/LittlePaimon/plugins/Paimon_Wiki/__init__.py b/LittlePaimon/plugins/Paimon_Wiki/__init__.py index dde46b0..0d4202b 100644 --- a/LittlePaimon/plugins/Paimon_Wiki/__init__.py +++ b/LittlePaimon/plugins/Paimon_Wiki/__init__.py @@ -159,6 +159,8 @@ async def _(event: MessageEvent, map_: str = Arg('map'), names=Arg('names')): if not freq_limiter.check(f'材料地图_{event.group_id if isinstance(event, GroupMessageEvent) else event.user_id}'): await material_map_full.finish(f'材料地图查询冷却中,剩余{freq_limiter.left(f"材料地图_{event.group_id if isinstance(event, GroupMessageEvent) else event.user_id}")}秒', at_sender=True) freq_limiter.start(f'材料地图_{event.group_id if isinstance(event, GroupMessageEvent) else event.user_id}', 15) + if len(names) > 3: + names = names[:3] await material_map_full.send(MessageBuild.Text(f'开始查找{"、".join(names)}的资源点,请稍候...')) result = await get_full_map(names, map_) await material_map_full.finish(result, at_sender=True) diff --git a/LittlePaimon/plugins/Paimon_Wiki/draw_map.py b/LittlePaimon/plugins/Paimon_Wiki/draw_map.py index b0f2fba..79c35fc 100644 --- a/LittlePaimon/plugins/Paimon_Wiki/draw_map.py +++ b/LittlePaimon/plugins/Paimon_Wiki/draw_map.py @@ -78,7 +78,7 @@ async def draw_map(name: str, map_: str): models.XYPoint(x1_temp, y1_temp), models.XYPoint(x2_temp, y2_temp), points)] - map_img = await load_image(RESOURCE_BASE_PATH / 'genshin_map' / 'results' / f'{map_id.name}.png') + map_img = (await load_image(RESOURCE_BASE_PATH / 'genshin_map' / 'results' / f'{map_id.name}.png')).copy() lt_point = group_point[0][0] rb_point = group_point[0][1] map_img = map_img.crop((int(lt_point.x), int(lt_point.y), int(rb_point.x), int(rb_point.y))) @@ -134,7 +134,7 @@ async def get_full_map(names: List[str], map_: str): resources_not.append(resource.name) if not resources_points: return MessageBuild.Text(f'{map_}未查找到材料{"、".join(names)},请尝试其他地图') - map_img = await load_image(RESOURCE_BASE_PATH / 'genshin_map' / 'results' / f'{map_id.name}.png') + map_img = (await load_image(RESOURCE_BASE_PATH / 'genshin_map' / 'results' / f'{map_id.name}.png')).copy() box_icon = await load_image(RESOURCE_BASE_PATH / 'genshin_map' / 'point_box.png') i = 0 max_point = XYPoint(x=0, y=0)