Added docker building.
This commit is contained in:
@ -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?;
|
||||
|
Reference in New Issue
Block a user