From b8fd3cfc19c0357f48b1085764d9969184213ba0 Mon Sep 17 00:00:00 2001 From: shenjack <3695888@qq.com> Date: Fri, 2 Aug 2024 19:25:39 +0800 Subject: [PATCH] ree --- ica-rs/src/config.rs | 6 +++++- ica-rs/src/tailchat.rs | 11 +++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/ica-rs/src/config.rs b/ica-rs/src/config.rs index c2e71d3..f1f36b0 100644 --- a/ica-rs/src/config.rs +++ b/ica-rs/src/config.rs @@ -1,6 +1,7 @@ use std::env; use std::fs; +use colored::Colorize; use serde::Deserialize; use toml::from_str; use tracing::warn; @@ -86,7 +87,10 @@ impl BotConfig { let mut args = env::args(); while let Some(arg) = args.next() { if arg == "-c" { - config_file_path = args.next().expect("No config path given"); + config_file_path = args.next().expect(&format!( + "{}", + "No config path given\nUsage: -c ".red() + )); break; } } diff --git a/ica-rs/src/tailchat.rs b/ica-rs/src/tailchat.rs index 27fcd0d..7fe2a9a 100644 --- a/ica-rs/src/tailchat.rs +++ b/ica-rs/src/tailchat.rs @@ -95,6 +95,17 @@ pub async fn start_tailchat( event!(Level::INFO, "{}", "tailchat 已经加入房间".green()); + if config.notice_start { + for (group, room) in config.notice_room { + let startup_msg = + crate::data_struct::tailchat::messages::SendingMessage::new_without_meta( + "ica-rs 启动成功", + group.clone(), + Some(room.clone()), + ); + } + } + stop_reciver.await.ok(); event!(Level::INFO, "socketio client stopping"); match socket.disconnect().await {