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)