From ee2c51fbcc8acbc5a1ec20ffd06c3981ac97fe38 Mon Sep 17 00:00:00 2001 From: shenjack <3695888@qq.com> Date: Sun, 18 Aug 2024 02:34:32 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E4=BF=AE=E8=A1=A5=E8=A1=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ica-rs/src/py/mod.rs | 5 ++++- ica-rs/src/tailchat.rs | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/ica-rs/src/py/mod.rs b/ica-rs/src/py/mod.rs index e889a1c..eb3c8d8 100644 --- a/ica-rs/src/py/mod.rs +++ b/ica-rs/src/py/mod.rs @@ -103,7 +103,10 @@ impl PyStatus { pub fn set_status(path: &Path, status: bool) { let cfg = Self::get_config_mut(); cfg.set_status(path, status); - cfg.sync_status_from_config(); + let map = Self::get_map_mut(); + if let Some(plugin) = map.get_mut(path) { + plugin.enabled = status; + } } pub fn display() -> String { diff --git a/ica-rs/src/tailchat.rs b/ica-rs/src/tailchat.rs index 8c4e418..0ae8914 100644 --- a/ica-rs/src/tailchat.rs +++ b/ica-rs/src/tailchat.rs @@ -15,7 +15,7 @@ use tracing::{event, span, Level}; use crate::config::TailchatConfig; use crate::data_struct::tailchat::status::{BotStatus, LoginData}; use crate::error::{ClientResult, TailchatError}; -use crate::{async_any_callback_with_state, async_callback_with_state, StopGetter}; +use crate::{async_any_callback_with_state, async_callback_with_state, version_str, StopGetter}; pub async fn start_tailchat( config: TailchatConfig, @@ -101,7 +101,7 @@ pub async fn start_tailchat( event!(Level::INFO, "发送启动消息到: {}|{}", con, group); let startup_msg = crate::data_struct::tailchat::messages::SendingMessage::new_without_meta( - format!("shenbot v{}-{} 启动成功", crate::VERSION, crate::TAILCHAT_VERSION), + version_str(), con.clone(), Some(group.clone()), );