Add cat pun loading messages

This commit is contained in:
Alex Page 2023-03-02 22:52:19 -05:00
parent 30ffacfef0
commit 90c65693de
3 changed files with 36 additions and 3 deletions

View file

@ -11,6 +11,7 @@ tracing = "0.1.37"
tracing-subscriber = "0.3.16"
tracing-futures = "0.2.5"
openai = "1.0.0-alpha.5"
rand = "0.8.5"
[dependencies.songbird]
version = "0.3.0"

View file

@ -81,9 +81,13 @@ pub async fn play(
}
if let Some(handler_lock) = manager.get(guild.id) {
let response = ctx
.send(|r| r.content("https://media.giphy.com/media/H1dxi6xdh4NGQCZSvz/giphy.gif"))
.await?;
let mut msg = MessageBuilder::new();
msg.push_line(String::from(openai::get_random_loading_message()))
.push_named_link(
"",
"https://media.giphy.com/media/H1dxi6xdh4NGQCZSvz/giphy.gif",
);
let response = ctx.send(|r| r.content(msg.build())).await?;
let mut handler = handler_lock.lock().await;

View file

@ -3,6 +3,34 @@ use openai::{
chat::{ChatCompletion, ChatCompletionRequestMessage},
models::ModelID,
};
use rand::seq::SliceRandom;
const LOADING_MESSAGES: [&str; 20] = [
"Hold your claws, I'm searching for the right tune.",
"Sorry, I was busy napping. Let me find your song meow.",
"Just a whisker longer, I'm on the hunt for your jam.",
"Be patient, I'm pawsitively searching for your requested song.",
"Let me caterwaul through my playlist to find your tune.",
"Feline a bit slow, but I'll find your song in no time.",
"Don't be catty, I'm just trying to find the right tune for you.",
"Just paws for a moment, I'm working on finding your song.",
"Hiss-terical, just need a moment to find your meow-sic.",
"Give me a few seconds, I'm furiously searching for your requested song.",
"Cat got my tongue! Just need a sec to find your track.",
"Let me use my cat-like reflexes to search for your song.",
"I'm not lion around, just give me a moment to find your tune.",
"Don't be hiss-ty, I'm searching for your requested song.",
"Just kitten around, I'll find your song in a jiffy.",
"Purr-haps it'll take me a moment, but I'll find your tune soon enough.",
"My paws are a little tired, but I'm still searching for your song!",
"Sorry, my cat nap ran a little long. Let me find your song now.",
"I'm not trying to be catty, just need a minute to find your tune.",
"Don't be fur-ious, I'm doing my best to find your requested song.",
];
pub fn get_random_loading_message() -> &'static str {
return LOADING_MESSAGES.choose(&mut rand::thread_rng()).unwrap();
}
pub async fn get_sassy_commentary(title: &str) -> Result<String> {
let system = [