Compare commits

...

13 commits

Author SHA1 Message Date
modulatingforce e1021c269d Merge pull request 'Custom this BotCommand' (#48) from say-this-guy into master
All checks were successful
ci/woodpecker/push/cargo-checks Pipeline was successful
Reviewed-on: #48
2024-04-09 15:49:58 -04:00
haruyuumei e41f7b0524 warning changed
All checks were successful
ci/woodpecker/pr/cargo-checks Pipeline was successful
2024-04-09 16:44:58 -03:00
haruyuumei 55aeaa7fc1 changed reply message on thisguy
All checks were successful
ci/woodpecker/pr/cargo-checks Pipeline was successful
2024-04-09 16:22:11 -03:00
HaruYuumei 93768de4dc Merge branch 'master' into say-this-guy
Some checks failed
ci/woodpecker/pr/cargo-checks Pipeline failed
2024-04-09 14:45:27 -04:00
haruyuumei b43d6f8159 Rewriten the code
All checks were successful
ci/woodpecker/pr/cargo-checks Pipeline was successful
working with command instead listener
2024-04-03 10:26:14 -03:00
haruyuumei 7e04699b67 making changes 2024-04-03 10:25:24 -03:00
haruyuumei d972eb7726 Thisguy working partially
All checks were successful
ci/woodpecker/pr/cargo-checks Pipeline was successful
not fully implemented reply to the reply
2024-04-02 20:11:01 -03:00
haruyuumei 72d4cf6d70 Small changes on thisguy.rs 2024-03-31 14:37:50 -03:00
haruyuumei a6ae5b3c47 Merge branch 'say-this-guy' of ssh://git.flake.sh:2222/modulatingforce/forcebot_rs into say-this-guy
All checks were successful
ci/woodpecker/pr/cargo-checks Pipeline was successful
2024-03-28 19:35:25 -03:00
haruyuumei fda7afb191 custom module working 2024-03-28 19:33:06 -03:00
modulatingforce 3ec51d66e5 Merge branch 'main' into say-this-guy
All checks were successful
ci/woodpecker/pr/cargo-checks Pipeline was successful
2024-03-28 17:55:00 -04:00
haruyuumei f8de595290 custom module update
All checks were successful
ci/woodpecker/pr/cargo-checks Pipeline was successful
2024-03-28 18:50:28 -03:00
haruyuumei 95a9962721 new module test
All checks were successful
ci/woodpecker/pr/cargo-checks Pipeline was successful
trying to add a new module
2024-03-28 15:38:49 -03:00
4 changed files with 67 additions and 6 deletions

View file

@ -13,6 +13,7 @@ pub use crate::core::botmodules::ModulesManager;
// mod experiments;
mod experimental;
mod thisguy;
// [ ] init() function that accepts bot instance - this is passed to init() on submodules
@ -21,5 +22,6 @@ pub async fn init(mgr: Arc<ModulesManager>) {
// this is achieved by calling submodules that also have fn init() defined
// experiments::init(mgr).await
experimental::init(mgr).await;
experimental::init(mgr.clone()).await;
thisguy::init(&mgr).await;
}

View file

@ -163,6 +163,7 @@ async fn good_girl(params : ExecBodyParams) {
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() == "haruyuumei".to_lowercase()
{
botlog::debug(
"Good Girl Detected > Pausechamp",
@ -180,8 +181,6 @@ async fn good_girl(params : ExecBodyParams) {
);
let bot = Arc::clone(&params.bot);
let botlock = bot.read().await;
// uses chat.say_in_reply_to() for the bot controls for messages
@ -194,8 +193,6 @@ async fn good_girl(params : ExecBodyParams) {
String::from("GoodGirl xdd "),
params.clone()
).await;
}
}
}

62
src/custom/thisguy.rs Normal file
View file

@ -0,0 +1,62 @@
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(&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(
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;
}

View file

@ -1,2 +1,2 @@
pub mod core;
pub mod custom;
pub mod custom;