mirror of
http://shenjack.top:5100/shenjack/icalingua-python-bot.git
synced 2025-02-23 07:19:59 +08:00
fmt
This commit is contained in:
parent
65b8e92ce1
commit
a63423d545
|
@ -246,12 +246,23 @@ fn set_str_cfg_default_plugin(
|
||||||
// 给到 on config
|
// 给到 on config
|
||||||
if let Ok(attr) = module.getattr(intern!(module.py(), ON_CONFIG_FUNC_NAME)) {
|
if let Ok(attr) = module.getattr(intern!(module.py(), ON_CONFIG_FUNC_NAME)) {
|
||||||
if !attr.is_callable() {
|
if !attr.is_callable() {
|
||||||
event!(Level::WARN, "Python 插件 {:?} 的 {} 函数不是 Callable", path, ON_CONFIG_FUNC_NAME);
|
event!(
|
||||||
|
Level::WARN,
|
||||||
|
"Python 插件 {:?} 的 {} 函数不是 Callable",
|
||||||
|
path,
|
||||||
|
ON_CONFIG_FUNC_NAME
|
||||||
|
);
|
||||||
return Ok(());
|
return Ok(());
|
||||||
}
|
}
|
||||||
let args = (config_str.as_bytes(), );
|
let args = (config_str.as_bytes(),);
|
||||||
if let Err(e) = attr.call1(args) {
|
if let Err(e) = attr.call1(args) {
|
||||||
event!(Level::WARN, "Python 插件 {:?} 的 {} 函数返回了一个报错 {}", path, ON_CONFIG_FUNC_NAME, e);
|
event!(
|
||||||
|
Level::WARN,
|
||||||
|
"Python 插件 {:?} 的 {} 函数返回了一个报错 {}",
|
||||||
|
path,
|
||||||
|
ON_CONFIG_FUNC_NAME,
|
||||||
|
e
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -305,12 +316,23 @@ fn set_bytes_cfg_default_plugin(
|
||||||
// 给到 on config
|
// 给到 on config
|
||||||
if let Ok(attr) = module.getattr(intern!(module.py(), ON_CONFIG_FUNC_NAME)) {
|
if let Ok(attr) = module.getattr(intern!(module.py(), ON_CONFIG_FUNC_NAME)) {
|
||||||
if !attr.is_callable() {
|
if !attr.is_callable() {
|
||||||
event!(Level::WARN, "Python 插件 {:?} 的 {} 函数不是 Callable", path, ON_CONFIG_FUNC_NAME);
|
event!(
|
||||||
|
Level::WARN,
|
||||||
|
"Python 插件 {:?} 的 {} 函数不是 Callable",
|
||||||
|
path,
|
||||||
|
ON_CONFIG_FUNC_NAME
|
||||||
|
);
|
||||||
return Ok(());
|
return Ok(());
|
||||||
}
|
}
|
||||||
let args = (&config_vec, );
|
let args = (&config_vec,);
|
||||||
if let Err(e) = attr.call1(args) {
|
if let Err(e) = attr.call1(args) {
|
||||||
event!(Level::WARN, "Python 插件 {:?} 的 {} 函数返回了一个报错 {}", path, ON_CONFIG_FUNC_NAME, e);
|
event!(
|
||||||
|
Level::WARN,
|
||||||
|
"Python 插件 {:?} 的 {} 函数返回了一个报错 {}",
|
||||||
|
path,
|
||||||
|
ON_CONFIG_FUNC_NAME,
|
||||||
|
e
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|
Loading…
Reference in New Issue
Block a user