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