From 79dbebdd4e9741ebbec8fe1388f90d17e97f6a9a Mon Sep 17 00:00:00 2001 From: shenjack <3695888@qq.com> Date: Wed, 5 Jun 2024 00:09:08 +0800 Subject: [PATCH] =?UTF-8?q?0.6.6=EF=BC=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ica-rs/src/data_struct/tailchat/messages.rs | 4 ++-- ica-rs/src/ica.rs | 2 +- ica-rs/src/py/call.rs | 4 ++-- ica-rs/src/tailchat.rs | 2 +- ica-rs/src/tailchat/client.rs | 2 +- news.md | 19 +++++++++++++++++++ 6 files changed, 26 insertions(+), 7 deletions(-) diff --git a/ica-rs/src/data_struct/tailchat/messages.rs b/ica-rs/src/data_struct/tailchat/messages.rs index bb32935..3f51390 100644 --- a/ica-rs/src/data_struct/tailchat/messages.rs +++ b/ica-rs/src/data_struct/tailchat/messages.rs @@ -54,9 +54,9 @@ impl ReciveMessage { } /// 回复这条消息 - pub fn reply_with(&self, content: &String) -> SendingMessage { + pub fn reply_with(&self, content: &str) -> SendingMessage { SendingMessage::new( - content.clone(), + content.to_string(), self.converse_id.clone(), self.group_id.clone(), Some(ReplyMeta::from_recive_message(self)), diff --git a/ica-rs/src/ica.rs b/ica-rs/src/ica.rs index 39daf5e..e08b458 100644 --- a/ica-rs/src/ica.rs +++ b/ica-rs/src/ica.rs @@ -77,7 +77,7 @@ pub async fn start_ica(config: &IcaConfig, stop_reciver: StopGetter) -> ClientRe rust_socketio::Error::IncompleteResponseFromEngineIo(inner_e) => { if inner_e.to_string().contains("AlreadyClosed") { event!(Level::INFO, "socketio client stopped"); - return Ok(()); + Ok(()) } else { event!(Level::ERROR, "socketio client stopped with error: {:?}", inner_e); Err(IcaError::SocketIoError( diff --git a/ica-rs/src/py/call.rs b/ica-rs/src/py/call.rs index f9f1021..5499419 100644 --- a/ica-rs/src/py/call.rs +++ b/ica-rs/src/py/call.rs @@ -2,7 +2,7 @@ use std::path::PathBuf; use pyo3::prelude::*; use rust_socketio::asynchronous::Client; -use tracing::{debug, info, warn}; +use tracing::{info, warn}; use crate::data_struct::{ica, tailchat}; use crate::error::PyPluginError; @@ -174,7 +174,7 @@ pub async fn tailchat_new_message_py(message: &tailchat::messages::ReciveMessage let plugins = PyStatus::get_files(); for (path, plugin) in plugins.iter() { - let msg = class::tailchat::TailchatReciveMessagePy::from_recive_message(&message); + let msg = class::tailchat::TailchatReciveMessagePy::from_recive_message(message); let client = class::tailchat::TailchatClientPy::new(client); let args = (msg, client); call_py_func!(args, plugin, path, TAILCHAT_NEW_MESSAGE_FUNC, client); diff --git a/ica-rs/src/tailchat.rs b/ica-rs/src/tailchat.rs index 1c1335b..ef5bf44 100644 --- a/ica-rs/src/tailchat.rs +++ b/ica-rs/src/tailchat.rs @@ -6,7 +6,7 @@ use md5::{Digest, Md5}; use reqwest::ClientBuilder as reqwest_ClientBuilder; use rust_socketio::asynchronous::{Client, ClientBuilder}; use rust_socketio::{Event, Payload, TransportType}; -use serde_json::{from_str, from_value, json, Value}; +use serde_json::{json, Value}; use tracing::{event, span, Level}; use crate::config::TailchatConfig; diff --git a/ica-rs/src/tailchat/client.rs b/ica-rs/src/tailchat/client.rs index 4437130..bba11a3 100644 --- a/ica-rs/src/tailchat/client.rs +++ b/ica-rs/src/tailchat/client.rs @@ -5,7 +5,7 @@ use rust_socketio::asynchronous::Client; use colored::Colorize; use serde_json::Value; -use tracing::{debug, info, span, warn, Level}; +use tracing::{debug, warn}; pub async fn send_message(client: &Client, message: &SendingMessage) -> bool { let value: Value = message.as_value(); diff --git a/news.md b/news.md index b31d0cb..d4a7c66 100644 --- a/news.md +++ b/news.md @@ -1,5 +1,24 @@ # 更新日志 +## 0.6.6 + +游学之前最后一次更新 +其实也就五天 + +正式支持了 tailchat 端 +好耶! + +[!note] +```text +notice_room = [] +notice_start = true + +admin_list = [] +filter_list = [] +``` + +的功能暂时不支持 + ## 0.6.5 怎么就突然 0.6.5 了