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 {