diff --git a/ica-rs/src/data_struct/tailchat/messages.rs b/ica-rs/src/data_struct/tailchat/messages.rs index 5bc7af6..36b9d0e 100644 --- a/ica-rs/src/data_struct/tailchat/messages.rs +++ b/ica-rs/src/data_struct/tailchat/messages.rs @@ -89,12 +89,7 @@ pub enum SendingFile { None, /// 需要生成 /// [img height=1329 width=1918]{BACKEND}/static/files/6602e20d7b8d10675758e36b/8db505b87bdf9fb309467abcec4d8e2a.png[/img] - Image { - file: Vec, - name: String, - width: u32, - height: u32, - }, + Image { file: Vec, name: String }, /// [card type=file url={BACKEND}/static/files/6602e20d7b8d10675758e36b/9df28943d17b9713cb0ea9625f37d015.wav]Engine.wav[/card] File { file: Vec, name: String }, } diff --git a/ica-rs/src/py/class/tailchat.rs b/ica-rs/src/py/class/tailchat.rs index e2971a5..7e50162 100644 --- a/ica-rs/src/py/class/tailchat.rs +++ b/ica-rs/src/py/class/tailchat.rs @@ -3,7 +3,7 @@ use pyo3::prelude::*; use rust_socketio::asynchronous::Client; use tracing::{debug, info, warn}; -use crate::data_struct::tailchat::messages::{ReceiveMessage, SendingMessage}; +use crate::data_struct::tailchat::messages::{ReceiveMessage, SendingFile, SendingMessage}; use crate::data_struct::tailchat::{ConverseId, GroupId, MessageId, UserId}; use crate::tailchat::client::send_message; @@ -124,7 +124,11 @@ impl TailchatSendingMessagePy { self.message.content = content; self.clone() } - // pub fn set_img(&mut self, file: Vec, file_type: String) { - // self.message.add_img(file, file_type, as_sticker); - // } + pub fn set_img(&mut self, file: Vec, file_name: String) { + let file = SendingFile::Image { + file, + name: file_name, + }; + self.message.add_img(file); + } }