This commit is contained in:
shenjack 2024-06-25 23:27:23 +08:00
parent 38d9988cdc
commit 4b1ed03b9a
Signed by: shenjack
GPG Key ID: 7B1134A979775551
2 changed files with 9 additions and 10 deletions

View File

@ -89,12 +89,7 @@ pub enum SendingFile {
None, None,
/// 需要生成 /// 需要生成
/// [img height=1329 width=1918]{BACKEND}/static/files/6602e20d7b8d10675758e36b/8db505b87bdf9fb309467abcec4d8e2a.png[/img] /// [img height=1329 width=1918]{BACKEND}/static/files/6602e20d7b8d10675758e36b/8db505b87bdf9fb309467abcec4d8e2a.png[/img]
Image { Image { file: Vec<u8>, name: String },
file: Vec<u8>,
name: String,
width: u32,
height: u32,
},
/// [card type=file url={BACKEND}/static/files/6602e20d7b8d10675758e36b/9df28943d17b9713cb0ea9625f37d015.wav]Engine.wav[/card] /// [card type=file url={BACKEND}/static/files/6602e20d7b8d10675758e36b/9df28943d17b9713cb0ea9625f37d015.wav]Engine.wav[/card]
File { file: Vec<u8>, name: String }, File { file: Vec<u8>, name: String },
} }

View File

@ -3,7 +3,7 @@ use pyo3::prelude::*;
use rust_socketio::asynchronous::Client; use rust_socketio::asynchronous::Client;
use tracing::{debug, info, warn}; 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::data_struct::tailchat::{ConverseId, GroupId, MessageId, UserId};
use crate::tailchat::client::send_message; use crate::tailchat::client::send_message;
@ -124,7 +124,11 @@ impl TailchatSendingMessagePy {
self.message.content = content; self.message.content = content;
self.clone() self.clone()
} }
// pub fn set_img(&mut self, file: Vec<u8>, file_type: String) { pub fn set_img(&mut self, file: Vec<u8>, file_name: String) {
// self.message.add_img(file, file_type, as_sticker); let file = SendingFile::Image {
// } file,
name: file_name,
};
self.message.add_img(file);
}
} }