mirror of
http://shenjack.top:5100/shenjack/icalingua-python-bot.git
synced 2024-11-23 12:41:05 +08:00
调整代码格式和样式
This commit is contained in:
parent
8b2a8ee8d2
commit
4b3da3b85f
|
@ -3,7 +3,7 @@
|
|||
# 最大行长
|
||||
max_width = 100
|
||||
# 链式调用的最大长度
|
||||
chain_width = 70
|
||||
chain_width = 80
|
||||
# 数组的最大长度
|
||||
array_width = 70
|
||||
# 函数参数的最大长度
|
||||
|
|
|
@ -28,10 +28,7 @@ pub async fn add_message(payload: Payload, client: Client) {
|
|||
if let Some(value) = values.first() {
|
||||
let message: NewMessage = serde_json::from_value(value.clone()).unwrap();
|
||||
// 检测是否在过滤列表内
|
||||
if IcalinguaStatus::get_config()
|
||||
.filter_list
|
||||
.contains(&message.msg.sender_id)
|
||||
{
|
||||
if IcalinguaStatus::get_config().filter_list.contains(&message.msg.sender_id) {
|
||||
return;
|
||||
}
|
||||
info!("add_message {}", message.to_string().cyan());
|
||||
|
|
|
@ -75,9 +75,8 @@ async fn main() {
|
|||
);
|
||||
std::thread::sleep(Duration::from_secs(1));
|
||||
info!("发送启动消息到房间: {}", room);
|
||||
if let Err(e) = socket
|
||||
.emit("sendMessage", serde_json::to_value(startup_msg).unwrap())
|
||||
.await
|
||||
if let Err(e) =
|
||||
socket.emit("sendMessage", serde_json::to_value(startup_msg).unwrap()).await
|
||||
{
|
||||
info!("启动信息发送失败 房间:{}|e:{}", room, e);
|
||||
}
|
||||
|
|
|
@ -107,11 +107,7 @@ pub fn load_py_plugins(path: &PathBuf) {
|
|||
|
||||
pub fn verify_plugins() {
|
||||
let mut need_reload_files: Vec<PathBuf> = Vec::new();
|
||||
let plugin_path = IcalinguaStatus::get_config()
|
||||
.py_plugin_path
|
||||
.as_ref()
|
||||
.unwrap()
|
||||
.to_owned();
|
||||
let plugin_path = IcalinguaStatus::get_config().py_plugin_path.as_ref().unwrap().to_owned();
|
||||
for entry in std::fs::read_dir(&plugin_path).unwrap() {
|
||||
if let Ok(entry) = entry {
|
||||
let path = entry.path();
|
||||
|
|
Loading…
Reference in New Issue
Block a user