This commit is contained in:
shenjack 2024-09-28 22:40:22 +08:00
parent ef3fb5a8cc
commit e5ff010a69
Signed by: shenjack
GPG Key ID: 7B1134A979775551
6 changed files with 41 additions and 5 deletions

2
Cargo.lock generated
View File

@ -659,7 +659,7 @@ dependencies = [
[[package]]
name = "ica-rs"
version = "0.7.2"
version = "0.7.3"
dependencies = [
"anyhow",
"base64 0.22.1",

View File

@ -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

View File

@ -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 {

View File

@ -149,6 +149,10 @@ impl SendMessagePy {
pub fn set_img(&mut self, file: Vec<u8>, 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 {

View File

@ -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<GroupId>) -> 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<u8>, file_name: String) {
let file = SendingFile::Image {
file,

22
news.md
View File

@ -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 表现不一致的问题(捂脸)