Thisguy working partially
All checks were successful
ci/woodpecker/pr/cargo-checks Pipeline was successful

not fully implemented reply to the reply
This commit is contained in:
haruyuumei 2024-04-02 20:11:01 -03:00
parent 72d4cf6d70
commit d972eb7726

View file

@ -6,12 +6,12 @@ use rand::Rng;
use std::sync::Arc; use std::sync::Arc;
use tokio::time::{sleep, Duration}; use tokio::time::{sleep, Duration};
//using the env file to get bot prefix //using the env file to get bot prefix
use std::env; use std::env;
use dotenv::dotenv; use dotenv::dotenv;
//bot function //bot function
async fn tsg(params: ExecBodyParams) { async fn tsg(params: ExecBodyParams) {
//Defining a var prefix to the prefix on the env file //Defining a var prefix to the prefix on the env file
@ -56,7 +56,7 @@ async fn tsg(params: ExecBodyParams) {
.await; .await;
sleep(Duration::from_secs_f64(0.5)).await; sleep(Duration::from_secs_f64(0.5)).await;
}else { }else {
println!("didn't type the proper command"); //println!("didn't type the proper command");
} }
} }
@ -91,37 +91,3 @@ async fn test(params: ExecBodyParams) {
Some(&params.msg), Some(&params.msg),
); );
} }
// just testing this area, not working atm
async fn replyer(params: ExecBodyParams)
{
/*
check if the command message was a reply
get reply message parent
reply to the parent
*/
//let reply_parent_message;
let reply_message: &String = &params.msg.message_text;
let my_reply:String = String::from("test");
//println!("{:?}",reply_parent_message);
println!("{}",reply_message);
botlog::debug(
"Oh god I love anime Girls!!",
Some("modules > thisguy()".to_string()),
Some(&params.msg),
);
let bot = Arc::clone(&params.bot);
let botlock = bot.read().await;
// uses chat.say_in_reply_to() for the bot controls for messages
botlock
.botmgrs
.chat
.say_in_reply_to(&params.msg, my_reply, params.clone())
.await;
sleep(Duration::from_secs_f64(0.5)).await;
}