diff options
Diffstat (limited to 'src/hooks/pet.rs')
| -rw-r--r-- | src/hooks/pet.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/hooks/pet.rs b/src/hooks/pet.rs index dcd8148..296c607 100644 --- a/src/hooks/pet.rs +++ b/src/hooks/pet.rs @@ -4,8 +4,8 @@ use anyhow::Result; use irc::client::prelude::*; use macros::privmsg; -use rand::thread_rng; use rand::seq::SliceRandom; +use rand::thread_rng; const PET_RESPONSE: [&str; 5] = [ "purrs", @@ -24,10 +24,10 @@ const PET_RESPONSE: [&str; 5] = [ /// - [`Bot::send_action`] /// - RESPONSE pub fn pet(bot: &crate::Bot, msg: Message) -> Result<()> { - let mut rng = thread_rng(); - let choice = PET_RESPONSE.choose(&mut rng); - privmsg!(msg, { - bot.send_action(msg.response_target().unwrap(), choice.unwrap())?; + bot.send_action( + msg.response_target().unwrap(), + PET_RESPONSE.choose(&mut thread_rng()).unwrap(), + )?; }) } |
