From bf406505fb457fb01427fa5a830534483438c898 Mon Sep 17 00:00:00 2001 From: shenjack <3695888@qq.com> Date: Wed, 25 Sep 2024 00:05:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=80=E5=BF=AB=E7=9A=84=E6=B7=B7=E6=88=98.p?= =?UTF-8?q?ng?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/namerena.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/plugins/namerena.py b/plugins/namerena.py index 66228c1..d05cfd0 100644 --- a/plugins/namerena.py +++ b/plugins/namerena.py @@ -33,7 +33,7 @@ else: TailchatReciveMessage = TypeVar("TailchatReciveMessage") -_version_ = "0.7.0" +_version_ = "0.7.1" CMD_PREFIX = "/namer" @@ -148,6 +148,7 @@ def run_fights(msg: ReciveMessage, client) -> None: # 以换行分割 fights = content.split("\n") results = [] + start_time = time.time() for fight in fights: # 以 + 分割 names = fight.split("+") @@ -174,7 +175,8 @@ def run_fights(msg: ReciveMessage, client) -> None: else: results.append(f"{out_result}{err_result}") # 输出 - reply = msg.reply_with("|".join(results)) + end_time = time.time() + reply = msg.reply_with(f"{"|".join(results)}\n耗时:{end_time - start_time:.2f}s\n版本:{_version_}-{'bun' if use_bun else 'node'}") client.send_message(reply) @@ -193,7 +195,7 @@ def dispatch_msg(msg: ReciveMessage, client) -> None: elif msg.content.startswith(EVAL_SIMPLE_CMD): # 放在最后, 避免覆盖 前面的命令 # 同时过滤掉别的 /namer-xxxxx - if msg.content.find(" ") != -1: + if not msg.content.startswith(f"{EVAL_SIMPLE_CMD}-"): eval_fight(msg, client)