Added docker building.

This commit is contained in:
2023-02-21 19:56:36 +00:00
parent f5b43573c8
commit b6ab9c8888
31 changed files with 1476 additions and 75 deletions

View File

@ -4,6 +4,17 @@ use rand::seq::IteratorRandom;
use crate::bot::handlers::base::Handler;
lazy_static::lazy_static! {
static ref GREETINGS: &'static [&'static str] = &[
"Привет!",
"Добрый день!",
"Здравствуйте.",
"Приетствую.",
"Доброго времени суток.",
];
}
/// Greeter just replies to greeting messages.
#[derive(Clone)]
pub struct Greeter;
@ -18,9 +29,8 @@ impl Handler for Greeter {
return Ok(());
}
let reply_text = ["Привет!", "Добрый день!", "Здравствуйте.", "Приетствую"]
.into_iter()
.choose(&mut rand::thread_rng());
// Choose random greeting from the list of greetings.
let reply_text = GREETINGS.iter().choose(&mut rand::thread_rng()).copied();
if let Some(text) = reply_text {
message.reply(text).await?;