From 66e82de28ff7397cbcfdac7a52a9f75c8859a7ee Mon Sep 17 00:00:00 2001 From: ModulatingForce <116608425+modulatingforce@users.noreply.github.com> Date: Sat, 24 Feb 2024 22:31:12 -0500 Subject: [PATCH] lib.rs --- Cargo.toml | 7 ++++++- src/lib.rs | 3 +++ src/main.rs | 17 +++++++++++------ 3 files changed, 20 insertions(+), 7 deletions(-) create mode 100644 src/lib.rs diff --git a/Cargo.toml b/Cargo.toml index 3b8edd4..70c9e9c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,4 +12,9 @@ twitch-irc = "5.0.1" rand = { version = "0.8.5", features = [] } futures = "0.3" async-trait = "0.1.77" -casual_logger = "0.6.5" \ No newline at end of file +casual_logger = "0.6.5" + + +[lib] +name = "botLib" +path = "src/lib.rs" \ No newline at end of file diff --git a/src/lib.rs b/src/lib.rs new file mode 100644 index 0000000..15558d2 --- /dev/null +++ b/src/lib.rs @@ -0,0 +1,3 @@ + +pub mod core; +pub mod modules; diff --git a/src/main.rs b/src/main.rs index 316483e..afd1526 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,12 +1,17 @@ -pub mod core; -pub mod modules; +// pub mod core; +// pub mod modules; +//use myLib; +//pub mod lib; use std::process::Output; -use crate::core::botinstance::ArcBox; +// use crate::core::botinstance::ArcBox; +use botLib::core::botinstance::ArcBox; + +use botLib::core::botinstance::{self,BotInstance}; +// use core::botinstance::{self,BotInstance}; -use crate::core::botinstance::{self,BotInstance}; use casual_logger::Extension; use tokio::sync::RwLock; use std::sync::Arc; @@ -32,12 +37,12 @@ pub async fn main() { for (_,acts) in &*a { for act in acts { match act { - crate::core::botmodules::BotAction::C(b) => { + botLib::core::botmodules::BotAction::C(b) => { // println!("bot actiions: {}",b.command) // Log::info(&format!("bot actions: {}",b.command)); botinstance::botlog::info(&format!("bot actions: {}",b.command), Some("main()".to_string()), None); }, - crate::core::botmodules::BotAction::L(l) => { + botLib::core::botmodules::BotAction::L(l) => { // println!("bot actiions: {}",l.name) // Log::info(&format!("bot actions: {}",l.name)); botinstance::botlog::info(&format!("bot actions: {}",l.name), Some("main()".to_string()), None);