From cfcac8f1c9eb9a0dd98b9be4a0721b8f3d9bee99 Mon Sep 17 00:00:00 2001 From: shenjack <3695888@qq.com> Date: Thu, 22 Feb 2024 14:30:56 +0800 Subject: [PATCH] 0.4.5 --- ica-rs/Cargo.toml | 2 +- ica-rs/ica_typing.py | 3 +++ ica-rs/plugins/bmcl.py | 4 ++-- ica-rs/src/py/class.rs | 4 ++++ 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ica-rs/Cargo.toml b/ica-rs/Cargo.toml index 84e1752..bc60efc 100644 --- a/ica-rs/Cargo.toml +++ b/ica-rs/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ica-rs" -version = "0.4.4" +version = "0.4.5" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/ica-rs/ica_typing.py b/ica-rs/ica_typing.py index fdc5318..b732c71 100644 --- a/ica-rs/ica_typing.py +++ b/ica-rs/ica_typing.py @@ -55,6 +55,9 @@ class NewMessage: @property def is_from_self(self) -> bool: ... + @property + def is_reply(self) -> bool: + ... class IcaClient: diff --git a/ica-rs/plugins/bmcl.py b/ica-rs/plugins/bmcl.py index 24d86ee..0f2cf8e 100644 --- a/ica-rs/plugins/bmcl.py +++ b/ica-rs/plugins/bmcl.py @@ -81,6 +81,6 @@ def bmcl(msg: NewMessage, client: IcaClient) -> None: def on_message(msg: NewMessage, client: IcaClient) -> None: - if not msg.is_from_self: - if msg.content == "/bmcl-rs": + if not (msg.is_from_self or msg.is_reply): + if msg.content == "/bmcl": bmcl(msg, client) diff --git a/ica-rs/src/py/class.rs b/ica-rs/src/py/class.rs index bba8664..09f5095 100644 --- a/ica-rs/src/py/class.rs +++ b/ica-rs/src/py/class.rs @@ -139,6 +139,10 @@ impl NewMessagePy { pub fn get_is_from_self(&self) -> bool { self.msg.is_from_self() } + #[getter] + pub fn get_is_reply(&self) -> bool { + self.msg.is_reply() + } } impl NewMessagePy {