Compare commits
No commits in common. "d972eb77266dedf9cdfae2189dd586699e4ca080" and "a6ae5b3c4744f58ba2370bfb355b2e762a85bf88" have entirely different histories.
d972eb7726
...
a6ae5b3c47
1 changed files with 17 additions and 35 deletions
|
@ -6,42 +6,25 @@ 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
|
//use rand::Rng;
|
||||||
use std::env;
|
|
||||||
use dotenv::dotenv;
|
|
||||||
|
|
||||||
//bot function
|
|
||||||
|
|
||||||
async fn tsg(params: ExecBodyParams) {
|
async fn tsg(params: ExecBodyParams) {
|
||||||
|
if params.msg.message_text == String::from("anime")
|
||||||
//Defining a var prefix to the prefix on the env file
|
|| params.msg.message_text == String::from("Anime")
|
||||||
dotenv().ok();
|
|
||||||
let prefix = env::var("prefix").unwrap();
|
|
||||||
/*
|
|
||||||
defining a text with the prefix + the command name (idk how to get the command)
|
|
||||||
so for now i'm typing the command
|
|
||||||
*/
|
|
||||||
let text = String::from(&prefix) + "This";
|
|
||||||
let text2 = String::from(&prefix) + "this";
|
|
||||||
|
|
||||||
//comparing the text sent with the text (prefix + command name)
|
|
||||||
if params.msg.message_text == text
|
|
||||||
|| params.msg.message_text == text2
|
|
||||||
{
|
{
|
||||||
let phrases: [String; 6] = [
|
let phrases: [String; 5] = [
|
||||||
"Clueless".to_string(),
|
"Aware oh no! Weebs...".to_string(),
|
||||||
"ICANT This guy....".to_string(),
|
"AYAYA I love anime Girls!!".to_string(),
|
||||||
"He is right tho".to_string(),
|
"I love 2d Girls ILOST ".to_string(),
|
||||||
"KEKW true!".to_string(),
|
"UOOHHHHH!!! Anime Girlssss".to_string(),
|
||||||
"OMEGALUL wth man...".to_string(),
|
"Anime girls u say? peepoShy ".to_string(),
|
||||||
"PepeLaugh El no sabe".to_string(),
|
|
||||||
];
|
];
|
||||||
|
|
||||||
let r = rand::thread_rng().gen_range(0..=4);
|
let r = rand::thread_rng().gen_range(0..=4);
|
||||||
let a = phrases[r].clone();
|
let a = phrases[r].clone();
|
||||||
|
|
||||||
botlog::debug(
|
botlog::debug(
|
||||||
"This guy works!",
|
"Oh god I love anime Girls!!",
|
||||||
Some("modules > thisguy()".to_string()),
|
Some("modules > thisguy()".to_string()),
|
||||||
Some(¶ms.msg),
|
Some(¶ms.msg),
|
||||||
);
|
);
|
||||||
|
@ -56,16 +39,16 @@ 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");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn init(mgr: &Arc<ModulesManager>) {
|
pub async fn init(mgr: &Arc<ModulesManager>) {
|
||||||
BotCommand {
|
BotCommand {
|
||||||
module: BotModule(String::from("thisguy")),
|
module: BotModule(String::from("thisguy")),
|
||||||
command: String::from("thisguy"),
|
command: String::from("anime"),
|
||||||
alias: vec![String::from("Thisguy")],
|
alias: vec![String::from("Anime")],
|
||||||
exec_body: actions_util::asyncbox(test),
|
exec_body: actions_util::asyncbox(tesst),
|
||||||
help: String::from("test"),
|
help: String::from("test"),
|
||||||
required_roles: vec![BotAdmin],
|
required_roles: vec![BotAdmin],
|
||||||
}
|
}
|
||||||
|
@ -82,11 +65,10 @@ pub async fn init(mgr: &Arc<ModulesManager>) {
|
||||||
.await;
|
.await;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async fn tesst(params: ExecBodyParams) {
|
||||||
async fn test(params: ExecBodyParams) {
|
println!("tesst triggered!"); // NOTE : This test function intends to print (e.g., to stdout) at fn call
|
||||||
println!("Test triggered!"); // NOTE : This test function intends to print (e.g., to stdout) at fn call
|
|
||||||
botlog::debug(
|
botlog::debug(
|
||||||
"test triggered!",
|
"tesst triggered!",
|
||||||
Some("modules > tesst()".to_string()),
|
Some("modules > tesst()".to_string()),
|
||||||
Some(¶ms.msg),
|
Some(¶ms.msg),
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in a new issue