From 73ca9747d6fe9380577c10150c8145337b59000c Mon Sep 17 00:00:00 2001 From: CMHopeSunshine <277073121@qq.com> Date: Wed, 28 Sep 2022 16:23:47 +0800 Subject: [PATCH] =?UTF-8?q?:sparkles:=20`=E6=9D=90=E6=96=99=E5=9C=B0?= =?UTF-8?q?=E5=9B=BE`=E6=94=AF=E6=8C=81=E6=B2=99=E6=BC=A0=EF=BC=8C?= =?UTF-8?q?=E8=AF=B7=E6=9B=B4=E6=96=B0=E5=90=8E=E4=BD=BF=E7=94=A8=E5=91=BD?= =?UTF-8?q?=E4=BB=A4`=E7=94=9F=E6=88=90=E5=9C=B0=E5=9B=BE`=E9=87=8D?= =?UTF-8?q?=E6=96=B0=E7=94=9F=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LittlePaimon/plugins/Genshin_Voice/__init__.py | 2 +- LittlePaimon/plugins/Paimon_Wiki/draw_map.py | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/LittlePaimon/plugins/Genshin_Voice/__init__.py b/LittlePaimon/plugins/Genshin_Voice/__init__.py index 9c7391d..be25b29 100644 --- a/LittlePaimon/plugins/Genshin_Voice/__init__.py +++ b/LittlePaimon/plugins/Genshin_Voice/__init__.py @@ -62,7 +62,7 @@ async def _(event: GroupMessageEvent, msg: Message = CommandArg(), lang=CommandL else: game = GuessVoice(event.group_id, pm.config.guess_voice_time, lang) result = await game.start() - await guess_voice.send('即将发送一段语音,将在30秒后公布答案') + await guess_voice.send(f'即将发送一段语音,将在{pm.config.guess_voice_time}秒后公布答案') try: await guess_voice.finish(result) except ActionFailed: diff --git a/LittlePaimon/plugins/Paimon_Wiki/draw_map.py b/LittlePaimon/plugins/Paimon_Wiki/draw_map.py index 1862a11..632686b 100644 --- a/LittlePaimon/plugins/Paimon_Wiki/draw_map.py +++ b/LittlePaimon/plugins/Paimon_Wiki/draw_map.py @@ -24,16 +24,17 @@ map_name_reverse = { } -async def init_map(refresh: bool = False): +async def init_map(): """ 初始化地图 - :param refresh: 是否刷新 """ for map_id in models.MapID: save_path = RESOURCE_BASE_PATH / 'genshin_map' / 'results' / f'{map_id.name}.png' save_path.parent.mkdir(parents=True, exist_ok=True) - if map_id.name == 'golden_apple_archipelago' or (save_path.exists() and not refresh): + if map_id.name == 'golden_apple_archipelago': continue + if save_path.exists(): + save_path.unlink() status_icon = await load_image(RESOURCE_BASE_PATH / 'genshin_map' / 'status_icon.png') anchor_icon = await load_image(RESOURCE_BASE_PATH / 'genshin_map' / 'anchor_icon.png') maps = await request.get_maps(map_id) @@ -46,7 +47,7 @@ async def init_map(refresh: bool = False): for point in anchor_points: map_img.paste(anchor_icon, (int(point.x) - 32, int(point.y) - 64), anchor_icon) map_img.save(save_path) - logger.info('原神地图', f'{map_name[map_id.name]}地图初始化完成') + logger.info('原神地图', f'{map_name[map_id.name]}地图生成完成') return f'地图资源生成完成,目前有{"、".join(list(map_name_reverse.keys()))}地图。'