diff --git a/src/main.rs b/src/main.rs index d7d6832..7f566df 100644 --- a/src/main.rs +++ b/src/main.rs @@ -214,7 +214,7 @@ async fn on_room_message(event: OriginalSyncRoomMessageEvent, room: Room) { room.send(reaction, None).await.unwrap(); } - if {let mut rng = rand::thread_rng(); rng.gen_range(0..2)} == 0 { + if {let mut rng = rand::thread_rng(); rng.gen_range(0..3)} == 0 { let msg = text_content.body .split_whitespace() .map(|x| schmfy(String::from(x.to_lowercase()))) @@ -231,15 +231,8 @@ async fn on_room_message(event: OriginalSyncRoomMessageEvent, room: Room) { } fn is_allowed_user(user: &str) -> bool { - println!("User: {}, bool: {}", user, !( - user.contains("bot_jonathan") - || user.contains("bot_jan") - || user.contains("bot_") - )); return !( - user.contains("bot_jonathan") - || user.contains("bot_jan") - || user.contains("bot_") + user.contains("bot_") ) } @@ -253,7 +246,8 @@ fn is_allowed_room(name: Option) -> bool { } }; - if room_name.to_lowercase().contains("spam") { + if room_name.to_lowercase().contains("spam") + || room_name.to_lowercase().contains("bot") { return true }