mirror of
https://github.com/xuthus83/LittlePaimon.git
synced 2024-12-16 13:40:53 +08:00
✨ 优化Wiki
命令,减少材料地图
太大而崩溃的可能性
This commit is contained in:
parent
8ad13992e0
commit
8cb2ba77c2
@ -269,10 +269,9 @@ async def _(event: MessageEvent, state: T_State, type: str = Arg('type'), name:
|
||||
await total_wiki.finish()
|
||||
elif len(matches) == 1 and len(list(matches.values())[0]) == 1:
|
||||
final_name = list(matches.values())[0][0]
|
||||
temp_type = list(matches.keys())[0]
|
||||
if type in {'材料', '攻略', '图鉴'}:
|
||||
type = list(matches.keys())[0] + type
|
||||
if type.endswith(('攻略', '图鉴')) and type.startswith(('原魔', '圣遗物', '武器', '七圣召唤')):
|
||||
type = f'{type[-2:]}图鉴'
|
||||
type = f'{temp_type}图鉴' if temp_type != '角色' else f'{temp_type}{type}'
|
||||
try:
|
||||
await total_wiki.finish(
|
||||
MessageSegment.image(API[type].format(proxy=config.github_proxy, name=final_name)))
|
||||
|
@ -163,6 +163,8 @@ async def get_full_map(names: List[str], map_: str):
|
||||
models.XYPoint(x1_temp, y1_temp),
|
||||
models.XYPoint(x2_temp, y2_temp),
|
||||
points)]
|
||||
if len(group_point[0][2]) > 400:
|
||||
group_point = img.k_means_points(points, 600)
|
||||
lt_point = group_point[0][0]
|
||||
rb_point = group_point[0][1]
|
||||
min_point = XYPoint(x=min(min_point.x, lt_point.x), y=min(min_point.y, lt_point.y))
|
||||
|
Loading…
x
Reference in New Issue
Block a user