mirror of
http://shenjack.top:5100/shenjack/icalingua-python-bot.git
synced 2024-11-23 12:41:05 +08:00
ree
This commit is contained in:
parent
c970e6ae45
commit
b8fd3cfc19
|
@ -1,6 +1,7 @@
|
||||||
use std::env;
|
use std::env;
|
||||||
use std::fs;
|
use std::fs;
|
||||||
|
|
||||||
|
use colored::Colorize;
|
||||||
use serde::Deserialize;
|
use serde::Deserialize;
|
||||||
use toml::from_str;
|
use toml::from_str;
|
||||||
use tracing::warn;
|
use tracing::warn;
|
||||||
|
@ -86,7 +87,10 @@ impl BotConfig {
|
||||||
let mut args = env::args();
|
let mut args = env::args();
|
||||||
while let Some(arg) = args.next() {
|
while let Some(arg) = args.next() {
|
||||||
if arg == "-c" {
|
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 <config_file_path>".red()
|
||||||
|
));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -95,6 +95,17 @@ pub async fn start_tailchat(
|
||||||
|
|
||||||
event!(Level::INFO, "{}", "tailchat 已经加入房间".green());
|
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();
|
stop_reciver.await.ok();
|
||||||
event!(Level::INFO, "socketio client stopping");
|
event!(Level::INFO, "socketio client stopping");
|
||||||
match socket.disconnect().await {
|
match socket.disconnect().await {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user