diff --git a/src/custom/text_mods.rs b/src/custom/text_mods.rs index 62c41ee..d0ec2a4 100644 --- a/src/custom/text_mods.rs +++ b/src/custom/text_mods.rs @@ -1,6 +1,8 @@ //! A module about editing and messing around with user text //! use std::collections::HashMap; +use std::os::windows::thread; +use std::string; use std::sync::Arc; use rand::{thread_rng, Rng}; use rand::seq::SliceRandom; @@ -117,7 +119,25 @@ pub async fn init(mgr: Arc) { } else { - //if it only has one word, shuffle its chars (exclude the n word monkaLaugh) + //if it only has one word, shuffle its chars + let word = usermessage.get(&1).unwrap(); + + let shuffle_word: String = + word.chars() + .collect::>() + .choose_multiple(&mut thread_rng(), word.len()) + .collect(); + + let bot = Arc::clone(¶ms.bot); + let botlock = bot.read().await; + botlock + .botmgrs + .chat + .say_in_reply_to( + ¶ms.msg, + shuffle_word, + params.clone() + ).await; } }