From 2695d658ab21e57b938f5a7998bb00346c5d5fdb Mon Sep 17 00:00:00 2001 From: Cinte Date: Mon, 13 Jun 2022 22:11:18 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E8=AF=8D=E6=9D=A1=E6=97=B6=E5=AF=B9answer=E4=B8=AD=E5=9B=BE?= =?UTF-8?q?=E7=89=87=E7=9A=84=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/word_bank/word_hanlde.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/word_bank/word_hanlde.py b/plugins/word_bank/word_hanlde.py index c8966a10..c58784b3 100644 --- a/plugins/word_bank/word_hanlde.py +++ b/plugins/word_bank/word_hanlde.py @@ -94,7 +94,7 @@ async def _(bot: Bot, event: GroupMessageEvent, state: T_State, arg: Message = C search_type = 2 _builder = await get__builder(event, _problem, answer, idx) if await _builder.save(search_type): - logger.info(f"已保存词条 问:{_builder.problem} 答:{msg}") + logger.info(f"已保存词条 问:{_builder.problem} 答:{answer}") await add_word.send("已保存词条:" + _builder.problem) else: await delete_word.send("保存失败,可能是回答重复") @@ -293,7 +293,7 @@ async def get__builder(event, _problem, answer, idx): if f"__placeholder_{rand}_{idx}.jpg" not in os.listdir(data_dir / f"{event.group_id}"): break rand = random.randint(1, 10000) + random.randint(1, 114514) - strinfo = re.compile(f"\[CQ:image,file={r.group(1)},url={_x_list[0]}\?{_x_list[1]},subType=\d*?]") + strinfo = re.compile(f"\[CQ:image,file={r.group(1)},.*url={_x_list[0]}\?{_x_list[1]}.*\]") answer = strinfo.sub(f"[__placeholder_{idx}]", answer) await AsyncHttpx.download_file( img, data_dir / f"{event.group_id}" / f"__placeholder_{rand}_{idx}.jpg"