dev into main #15

Merged
modulatingforce merged 40 commits from dev into main 2024-02-25 11:31:11 -05:00
5 changed files with 827 additions and 55 deletions
Showing only changes of commit 2d5fa269de - Show all commits

5
.gitignore vendored
View file

@ -19,4 +19,7 @@ target/
# log
*.log
*.log
# debug
.vscode/

View file

@ -66,6 +66,16 @@ pub mod botlog {
// trace, debug, info, notice, warn, error, fatal
/*
in main : Log::debug("Checking bot actions", Some("main()".to_string()), None);
in log :
[blalba@timestmp]
debug = "Checking bot actions",
*/
pub fn trace(in_msg:&str,in_module:Option<String>,in_prvmsg:Option<&PrivmsgMessage>) -> ()
{
@ -86,6 +96,8 @@ pub mod botlog {
.str("Chatter",&format!("{:?}",chatter))
.str("Code_Module",&format!("{:?}",in_module))
);
}
@ -385,6 +397,8 @@ pub struct BotInstance
pub twitch_oauth : String,
pub bot_channels : Vec<ChType>,
pub botmgrs : BotManagers,
//modesmgr : ModesManager, // Silent/Quiet , uwu , frisky/horny
}
@ -435,7 +449,17 @@ impl BotInstance
let b = BotInstance {
// let b = BotInstance {
// prefix : prefix,
// bot_channel : Channel(login_name) ,
// incoming_messages : Arc::new(RwLock::new(incoming_messages)),
// botmodules : ModulesManager::init().await,
// twitch_oauth : oauth_token,
// bot_channels : botchannels,
// botmgrs : BotManagers::init(ratelimiters,client),
// };
BotInstance {
prefix : prefix,
bot_channel : Channel(login_name) ,
incoming_messages : Arc::new(RwLock::new(incoming_messages)),
@ -443,10 +467,9 @@ impl BotInstance
twitch_oauth : oauth_token,
bot_channels : botchannels,
botmgrs : BotManagers::init(ratelimiters,client),
};
}
b
// b
}
pub async fn runner(self) -> () {

View file

@ -55,11 +55,12 @@ pub enum ModType {
pub use ModType::BotModule;
#[derive(Debug, PartialEq, Eq, Hash, Clone)]
pub enum ChType {
Channel(String),
}
// #[derive(Debug, PartialEq, Eq, Hash, Clone)]
// pub enum ChType {
// Channel(String),
// }
use botinstance::ChType;
pub use ChType::Channel;
use twitch_irc::message::PrivmsgMessage;
@ -234,6 +235,20 @@ pub struct ModulesManager
pub botactions: Arc<RwLock<HashMap<ModType,Vec<BotAction>>>>,
}
/*
statusdb
<HashMap
<ModType, <-- e.g., BotModule(String::from("experiments001"))
Vec<ModStatusType> <-- shows Enabled/Disabled per Status level
botactions
HashMap<
ModType, <-- e.g., BotModule(String::from("experiments001"))
Vec<BotAction>> BotCommand, Listener
*/
impl ModulesManager
{

File diff suppressed because it is too large Load diff

View file

@ -14,10 +14,10 @@
use std::future::Future;
use crate::core::botmodules::{ModulesManager,Listener,BotModule,BotActionTrait, BotCommand,ChType};
use crate::core::botmodules::{ModulesManager,Listener,BotModule,BotActionTrait, BotCommand};
use crate::core::botmodules::bot_actions::actions_util::{self, BotAR};
use crate::core::botinstance::{self,BotInstance};
use crate::core::botinstance::{self,BotInstance,ChType};
use futures::lock::Mutex;
use twitch_irc::message::PrivmsgMessage;