From 6861c820bd2a03fc740b94ccf75c5b82444b772c Mon Sep 17 00:00:00 2001 From: starrysky <2152773194@qq.com> Date: Sun, 26 Jan 2025 11:53:01 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=B0=E7=90=83=E6=9D=91=E7=89=B9=E4=BE=9B?= =?UTF-8?q?=E6=97=A0=E9=99=90=E5=88=B6=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main.rs | 4 ++-- src/utils.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index 4a3f160..2c9f9f7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -44,8 +44,8 @@ async fn main() { let configuration = Configuration::new("config.json"); let configuration_rc = Arc::new(configuration); let mut spam_file = None; - if configuration_rc.username_prefix().len() > 14 { - error!("Error: Username prefix should not longer than 14"); + if configuration_rc.username_prefix().len() > 30 { + error!("Error: Username prefix should not longer than 30"); return; } if !configuration_rc.clone().spam_file().is_empty() { diff --git a/src/utils.rs b/src/utils.rs index 0037cd0..352a7b0 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -57,6 +57,6 @@ pub fn generate_string(len_min: i64, len_max: i64) -> String { pub fn generate_username(config: &Arc) -> String { config.username_prefix().to_string() + generate_string( - 2,16-config.username_prefix().len() as i64 + 2,32-config.username_prefix().len() as i64 ).to_string().as_str() } \ No newline at end of file