From 4656655017e572e153c67dde6f9e001447ba3525 Mon Sep 17 00:00:00 2001 From: shenjack <3695888@qq.com> Date: Mon, 26 Feb 2024 06:11:17 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E4=B8=AA=E5=90=8D=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ica-rs/plugins/{save_eval.py => save_eval.pyi} | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) rename ica-rs/plugins/{save_eval.py => save_eval.pyi} (88%) diff --git a/ica-rs/plugins/save_eval.py b/ica-rs/plugins/save_eval.pyi similarity index 88% rename from ica-rs/plugins/save_eval.py rename to ica-rs/plugins/save_eval.pyi index d44fd3c..e4fb333 100644 --- a/ica-rs/plugins/save_eval.py +++ b/ica-rs/plugins/save_eval.pyi @@ -71,10 +71,10 @@ def safe_eval(code: str, msg: NewMessage) -> str: return result -# def on_message(message: NewMessage, client: IcaClient) -> None: -# if not (message.is_from_self or message.is_reply): -# if message.content.startswith("/="): -# code = message.content[2:] -# result = safe_eval(code, message) -# reply = message.reply_with(result) -# client.send_message(reply) +def on_message(message: NewMessage, client: IcaClient) -> None: + if not (message.is_from_self or message.is_reply): + if message.content.startswith("/="): + code = message.content[2:] + result = safe_eval(code, message) + reply = message.reply_with(result) + client.send_message(reply)