Add random title to sauce message

Signed-off-by: trivernis <trivernis@protonmail.com>
pull/8/head
trivernis 3 years ago
parent dc8a84c51e
commit 15a06abf22
Signed by: Trivernis
GPG Key ID: DFFFCC2C7A02DB45

@ -8,10 +8,17 @@ use bot_coreutils::url::get_domain_for_url;
use crate::utils::error::BotResult;
use bot_serenityutils::menu::MenuBuilder;
use rand::prelude::SliceRandom;
use std::time::Duration;
static MAX_RESULTS: usize = 6;
static MIN_SIMILARITY: f32 = 50.0;
static SAUCE_MESSAGES: &[&str] = &[
"Here's your mayonnaise",
"Here's your punched tomatoes",
"Warning: It's tabasco",
"Yum, apple sauce",
];
/// Builds a new sauce menu
pub async fn show_sauce_menu(
@ -79,9 +86,10 @@ fn create_sauce_page<'a>(mut result: SauceResult) -> CreateMessage<'a> {
item.link
));
}
let mut rng = rand::thread_rng();
message.embed(|e| {
e.title("Sources")
e.title(SAUCE_MESSAGES.choose(&mut rng).unwrap())
.description(description_lines.join("\n"))
.thumbnail(original)
.footer(|f| f.text("Powered by SauceNAO"))

Loading…
Cancel
Save