This commit is contained in:
Ladislav Hano 2024-02-16 22:49:57 +01:00
parent fc3685e471
commit 6792f8192b

View file

@ -1,4 +1,5 @@
use rand::random; use rand::random;
use serenity::http::CacheHttp;
use serenity::{client::Context, http::Http}; use serenity::{client::Context, http::Http};
use serenity::model::channel::Message; use serenity::model::channel::Message;
use std::sync::Arc; use std::sync::Arc;
@ -28,12 +29,19 @@ pub async fn handle(ctx: Context, msg: Message) {
} }
} }
if random::<u16>() % 1000 == 666 {
match msg.reply(ctx.http(), "Povedz loď").await {
Ok(_) => {},
Err(e) => send_error(ctx.http.clone(), e.to_string()).await
}
}
let channel_id = match moove_check(&msg).await { let channel_id = match moove_check(&msg).await {
Some(val) => val, Some(val) => val,
None => return None => return
}; };
match moove(ctx.http, msg, channel_id).await { match moove(ctx.http, msg.clone(), channel_id).await {
Ok(_) => return, Ok(_) => return,
Err(e) => println!("ERROR: {e}") Err(e) => println!("ERROR: {e}")
}; };