Compare commits
No commits in common. "master" and "cargo-fmt" have entirely different histories.
4 changed files with 6 additions and 67 deletions
|
@ -13,7 +13,6 @@ pub use crate::core::botmodules::ModulesManager;
|
||||||
|
|
||||||
// mod experiments;
|
// mod experiments;
|
||||||
mod experimental;
|
mod experimental;
|
||||||
mod thisguy;
|
|
||||||
|
|
||||||
// [ ] init() function that accepts bot instance - this is passed to init() on submodules
|
// [ ] init() function that accepts bot instance - this is passed to init() on submodules
|
||||||
|
|
||||||
|
@ -22,6 +21,5 @@ pub async fn init(mgr: Arc<ModulesManager>) {
|
||||||
// this is achieved by calling submodules that also have fn init() defined
|
// this is achieved by calling submodules that also have fn init() defined
|
||||||
|
|
||||||
// experiments::init(mgr).await
|
// experiments::init(mgr).await
|
||||||
experimental::init(mgr.clone()).await;
|
experimental::init(mgr).await;
|
||||||
thisguy::init(&mgr).await;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -163,7 +163,6 @@ async fn good_girl(params : ExecBodyParams) {
|
||||||
|
|
||||||
if params.msg.sender.name.to_lowercase() == "ModulatingForce".to_lowercase()
|
if params.msg.sender.name.to_lowercase() == "ModulatingForce".to_lowercase()
|
||||||
|| params.msg.sender.name.to_lowercase() == "mzNToRi".to_lowercase()
|
|| params.msg.sender.name.to_lowercase() == "mzNToRi".to_lowercase()
|
||||||
|| params.msg.sender.name.to_lowercase() == "haruyuumei".to_lowercase()
|
|
||||||
{
|
{
|
||||||
botlog::debug(
|
botlog::debug(
|
||||||
"Good Girl Detected > Pausechamp",
|
"Good Girl Detected > Pausechamp",
|
||||||
|
@ -181,6 +180,8 @@ async fn good_girl(params : ExecBodyParams) {
|
||||||
);
|
);
|
||||||
|
|
||||||
let bot = Arc::clone(¶ms.bot);
|
let bot = Arc::clone(¶ms.bot);
|
||||||
|
|
||||||
|
|
||||||
let botlock = bot.read().await;
|
let botlock = bot.read().await;
|
||||||
|
|
||||||
// uses chat.say_in_reply_to() for the bot controls for messages
|
// uses chat.say_in_reply_to() for the bot controls for messages
|
||||||
|
@ -193,6 +194,8 @@ async fn good_girl(params : ExecBodyParams) {
|
||||||
String::from("GoodGirl xdd "),
|
String::from("GoodGirl xdd "),
|
||||||
params.clone()
|
params.clone()
|
||||||
).await;
|
).await;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,62 +0,0 @@
|
||||||
use crate::core::bot_actions::*;
|
|
||||||
use crate::core::botinstance::Channel;
|
|
||||||
use crate::core::botlog;
|
|
||||||
use crate::core::botmodules::{BotActionTrait, BotCommand, BotModule, ModulesManager};
|
|
||||||
use crate::core::identity::UserRole::*;
|
|
||||||
use rand::Rng;
|
|
||||||
use twitch_irc::message::ReplyToMessage;
|
|
||||||
use std::sync::Arc;
|
|
||||||
use tokio::time::{sleep, Duration};
|
|
||||||
const OF_CMD_CHANNEL:Channel = Channel(String::new());
|
|
||||||
|
|
||||||
async fn tsg(params: ExecBodyParams) {
|
|
||||||
|
|
||||||
let phrases: [String; 6] = [
|
|
||||||
"Clueless ".to_string(),
|
|
||||||
"ICANT This guy....".to_string(),
|
|
||||||
"He is right tho".to_string(),
|
|
||||||
"KEKW true!".to_string(),
|
|
||||||
"OMEGALUL wth man...".to_string(),
|
|
||||||
"PepeLaugh El no sabe".to_string(),
|
|
||||||
];
|
|
||||||
|
|
||||||
let r = rand::thread_rng().gen_range(0..=4);
|
|
||||||
let a = phrases[r].clone();
|
|
||||||
|
|
||||||
botlog::debug(
|
|
||||||
"This guy works!",
|
|
||||||
Some("modules > thisguy()".to_string()),
|
|
||||||
Some(¶ms.msg),
|
|
||||||
);
|
|
||||||
let bot = Arc::clone(¶ms.bot);
|
|
||||||
let botlock = bot.read().await;
|
|
||||||
|
|
||||||
// uses chat.say_in_reply_to() for the bot controls for messages
|
|
||||||
botlock
|
|
||||||
.botmgrs
|
|
||||||
.chat
|
|
||||||
.say_in_reply(
|
|
||||||
Channel(params.clone().msg.channel_login().to_string()),
|
|
||||||
a,
|
|
||||||
params.clone()
|
|
||||||
)
|
|
||||||
.await;
|
|
||||||
sleep(Duration::from_secs_f64(0.5)).await;
|
|
||||||
}
|
|
||||||
|
|
||||||
pub async fn init(mgr: &Arc<ModulesManager>) {
|
|
||||||
BotCommand {
|
|
||||||
module: BotModule(String::from("thisguy")),
|
|
||||||
command: String::from("thisguy"),
|
|
||||||
alias: vec![String::from("Thisguy")],
|
|
||||||
exec_body: actions_util::asyncbox(tsg),
|
|
||||||
help: String::from("test"),
|
|
||||||
required_roles: vec![
|
|
||||||
BotAdmin,
|
|
||||||
Mod(OF_CMD_CHANNEL),
|
|
||||||
Broadcaster
|
|
||||||
],
|
|
||||||
}
|
|
||||||
.add_to_modmgr(Arc::clone(mgr))
|
|
||||||
.await;
|
|
||||||
}
|
|
Loading…
Reference in a new issue