aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMax Audron <audron@cocaine.farm>2021-06-06 18:03:04 +0200
committerMax Audron <audron@cocaine.farm>2021-06-06 18:03:04 +0200
commite41f23d3f29722c472d656af5823d4566dea95cb (patch)
treeec2ddebbf7491b70257ad304a7d74b7fb6d4bd8b /src
parentfeat: adds pet command. (diff)
Diffstat (limited to '')
-rw-r--r--src/hooks/pet.rs10
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(),
+ )?;
})
}
> 2025-05-06remove too commonly used used for shifty_eyesMax Audron-1/+1 2025-05-06fix truncate on unicodeMax Audron-10/+20 2025-05-06update dependenciesMax Audron-691/+1659 2024-08-12add nix build and moduleMax Audron-5/+427 2022-02-19remove jsonnet lock fileMax Audron-36/+0 2022-02-19fix deploy to work with gitlab agentMax Audron-4/+4 2021-10-22write tons of documentation and reorganize some modulesMax Audron-65/+300 2021-10-22remove wolfram alpha url shorteningMax Audron-1/+2 2021-10-20remove failing wolfram alpha test casesMax Audron-105/+55 2021-10-20bump version to 1.6.2Max Audron-3/+2 2021-10-20prepare for release on crates.ioMax Audron-39/+65 2021-10-20add async docs to macro crate and bump versionMax Audron-9/+10 2021-10-20change hook errors to be logged as warningsMax Audron-3/+3 2021-10-20fix configuration not loading correctly on release buildsMax Audron-8/+23 2021-10-19replace sedregex crate8-rework-sedMax Audron-20/+358 2021-10-19add formatting trait for irc codesMax Audron-0/+129 2021-10-17fix links in readmeMax Audron-2/+2