Custom this BotCommand #48

Merged
modulatingforce merged 12 commits from say-this-guy into master 2024-04-09 15:49:58 -04:00
Showing only changes of commit d972eb7726 - Show all commits

View file

@ -6,12 +6,12 @@ use rand::Rng;
use std::sync::Arc;
use tokio::time::{sleep, Duration};
//using the env file to get bot prefix
use std::env;
use dotenv::dotenv;
//bot function
async fn tsg(params: ExecBodyParams) {
//Defining a var prefix to the prefix on the env file
@ -56,7 +56,7 @@ async fn tsg(params: ExecBodyParams) {
.await;
sleep(Duration::from_secs_f64(0.5)).await;
}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),
);
}
// 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;
}