Skip to content

Commit

Permalink
fix: allow no cipher
Browse files Browse the repository at this point in the history
  • Loading branch information
itsusinn committed Oct 27, 2021
1 parent 6611dff commit 10a2b52
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,19 @@ fn main() {
}
#[allow(unused_must_use)]
async fn run() -> Result<(), anyhow::Error> {
if !CONFIG.enabled {
if !CONFIG.enable {
log::warn!("Mesagisto-Bot is not enabled and is about to exit the program.");
log::warn!("To enable it, please modify the configuration file.");
log::warn!("Mesagisto-Bot未被启用,即将退出程序。");
log::warn!("若要启用,请修改配置文件。");
return Ok(());
}
CACHE.init();
CIPHER.init(&CONFIG.cipher.key,&CONFIG.cipher.refuse_plain);
if CONFIG.cipher.enable {
CIPHER.init(&CONFIG.cipher.key,&CONFIG.cipher.refuse_plain);
} else {
CIPHER.deinit();
}
log::info!("Mesagisto-Bot is starting up");
log::info!("Mesagisto-Bot正在启动");
DB.init(ArcStr::from("tg").some());
Expand Down

0 comments on commit 10a2b52

Please sign in to comment.