From 3959dd3dc763860f833165b0989610407184e7d7 Mon Sep 17 00:00:00 2001 From: shenjack-5600u <3695888@qq.com> Date: Tue, 7 May 2024 21:55:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0namerena=EF=BC=8C=E8=A7=A3?= =?UTF-8?q?=E5=86=B3/namerenea=E5=B8=A6=E4=BA=86=E5=B0=B1=E6=B2=A1?= =?UTF-8?q?=E6=B3=95=E7=94=A8=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ica-rs/plugins/namerena.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ica-rs/plugins/namerena.py b/ica-rs/plugins/namerena.py index 1a0ec2b..714a761 100644 --- a/ica-rs/plugins/namerena.py +++ b/ica-rs/plugins/namerena.py @@ -15,8 +15,9 @@ else: IcaNewMessage = TypeVar("NewMessage") IcaClient = TypeVar("IcaClient") -_version_ = "0.2.0" +_version_ = "0.3.0" +COMMAND = "/namerena" def on_ica_message(msg: IcaNewMessage, client: IcaClient) -> None: if not msg.content.startswith("/namerena"): @@ -24,12 +25,12 @@ def on_ica_message(msg: IcaNewMessage, client: IcaClient) -> None: if msg.content.find("\n") == -1: client.send_message( msg.reply_with( - "请使用 /namerena 命令,然后换行输入名字,例如:\n/namerena\n张三\n李四\n王五\n" + f"请使用 {COMMAND} 命令,然后换行输入名字,例如:\n{COMMAND}\n张三\n李四\n王五\n" ) ) return # 去掉 /name - names = msg.content.split("/namerena")[1] + names = msg.content[len(COMMAND) :] # 去掉第一个 \n names = names[names.find("\n") + 1 :]