From e5ff010a6968271a27e2ee5a33a42db5b9efea72 Mon Sep 17 00:00:00 2001 From: shenjack <3695888@qq.com> Date: Sat, 28 Sep 2024 22:40:22 +0800 Subject: [PATCH] 0.7.3 --- Cargo.lock | 2 +- ica-rs/Cargo.toml | 2 +- ica-rs/src/main.rs | 6 +++--- ica-rs/src/py/class/ica.rs | 4 ++++ ica-rs/src/py/class/tailchat.rs | 10 ++++++++++ news.md | 22 ++++++++++++++++++++++ 6 files changed, 41 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 85f12f7..b507581 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -659,7 +659,7 @@ dependencies = [ [[package]] name = "ica-rs" -version = "0.7.2" +version = "0.7.3" dependencies = [ "anyhow", "base64 0.22.1", diff --git a/ica-rs/Cargo.toml b/ica-rs/Cargo.toml index 089987b..35c6c11 100644 --- a/ica-rs/Cargo.toml +++ b/ica-rs/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ica-rs" -version = "0.7.2" +version = "0.7.3" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/ica-rs/src/main.rs b/ica-rs/src/main.rs index 93aa435..160d753 100644 --- a/ica-rs/src/main.rs +++ b/ica-rs/src/main.rs @@ -29,8 +29,8 @@ pub type MainStatus = status::BotStatus; pub type StopGetter = tokio::sync::oneshot::Receiver<()>; pub const VERSION: &str = env!("CARGO_PKG_VERSION"); -pub const ICA_VERSION: &str = "1.6.3"; -pub const TAILCHAT_VERSION: &str = "1.2.3"; +pub const ICA_VERSION: &str = "1.6.4"; +pub const TAILCHAT_VERSION: &str = "1.2.4"; const HELP_MSG: &str = r#"/bot-rs 展示 rust 侧信息 @@ -73,7 +73,7 @@ pub fn version_str() -> String { /// 是否为稳定版本 /// 会在 release 的时候设置为 true -pub const STABLE: bool = true; +pub const STABLE: bool = false; #[macro_export] macro_rules! async_callback_with_state { diff --git a/ica-rs/src/py/class/ica.rs b/ica-rs/src/py/class/ica.rs index da36ac7..2513fe1 100644 --- a/ica-rs/src/py/class/ica.rs +++ b/ica-rs/src/py/class/ica.rs @@ -149,6 +149,10 @@ impl SendMessagePy { pub fn set_img(&mut self, file: Vec, file_type: String, as_sticker: bool) { self.msg.set_img(&file, &file_type, as_sticker); } + pub fn remove_reply(&mut self) -> Self { + self.msg.reply_to = None; + self.clone() + } } impl SendMessagePy { diff --git a/ica-rs/src/py/class/tailchat.rs b/ica-rs/src/py/class/tailchat.rs index c820d5e..4c2df42 100644 --- a/ica-rs/src/py/class/tailchat.rs +++ b/ica-rs/src/py/class/tailchat.rs @@ -72,6 +72,12 @@ impl TailchatClientPy { pub fn get_tailchat_version(&self) -> String { crate::TAILCHAT_VERSION.to_string() } #[getter] pub fn get_startup_time(&self) -> SystemTime { crate::MainStatus::get_startup_time() } + #[pyo3(signature = (content, converse_id, group_id = None))] + pub fn new_message(&self, content: String, converse_id: ConverseId, group_id: Option) -> TailchatSendingMessagePy { + TailchatSendingMessagePy { + message: SendingMessage::new(content, converse_id, group_id, None), + } + } pub fn debug(&self, content: String) { debug!("{}", content); } @@ -132,6 +138,10 @@ impl TailchatSendingMessagePy { self.message.content = content; self.clone() } + pub fn clear_meta(&mut self) -> Self { + self.message.meta = None; + self.clone() + } pub fn set_img(&mut self, file: Vec, file_name: String) { let file = SendingFile::Image { file, diff --git a/news.md b/news.md index 1633830..702d6fd 100644 --- a/news.md +++ b/news.md @@ -1,5 +1,27 @@ # 更新日志 +## 0.7.3 + +添加了一些新的 api + +### ica 1.6.4 + +- 给 `SendMessagePy` + - 添加了 `remove_reply` 方法 + - 用于取消回复状态 +- 删除了 `Room` 的 `auto_download` 和 `download_path` 字段 + - 因为这两个字段也没啥用 + +### tailcaht 1.2.4 + +- 给 `TailchatClientPy` + - 添加了 `new_message` 方法 + - 用于创建新的消息 +- 给 `TailchatSendingMessagePy` + - 添加了 `clear_meta` 功能 + - 用于清除 `meta` 字段 + - 可以用来取消回复状态 + ## 0.7.2 - 修复了一些 ica 和 tailchat 表现不一致的问题(捂脸)