[INIT] modules manager

This commit is contained in:
ModulatingForce 2023-12-21 00:48:09 -05:00
commit ad137f5530
3 changed files with 163 additions and 1 deletions

View file

@ -22,6 +22,10 @@ use crate::core::ratelimiter::RateLimiter;
use crate::core::ratelimiter;
// use crate::core::ratelimiter;
use crate::core::botmodules;
use crate::core::botmodules::ModulesManager;
#[derive(Debug, PartialEq, Eq, Hash)]
pub enum ChType {
Channel(String),
@ -42,6 +46,13 @@ pub enum EnType {
pub use EnType::Enabled;
// pub enum ModStatusType {
// Enabled(EnType),
// Disabled(EnType),
// Enabled(ModType),
// Disabled(ModType),
// }
pub struct BotInstance {
prefix : char,
@ -50,6 +61,7 @@ pub struct BotInstance {
pub incoming_messages : UnboundedReceiver<ServerMessage>,
pub ratelimiters : HashMap<ChType,RateLimiter>, // used to limit messages sent per channel
// botmodules : HashMap<ModType,Vec<EnType>>,
botmodules : ModulesManager,
twitch_oauth : String,
pub bot_channels : Vec<ChType>,
/*bot_commands : Vec[BotCommand],
@ -109,6 +121,7 @@ impl BotInstance {
client : client,
ratelimiters : ratelimiters, // used to limit messages sent per channel
// botmodules : HashMap::new(),
botmodules : ModulesManager::init(),
twitch_oauth : oauth_token,
bot_channels : botchannels,
/*bot_commands : Vec[BotCommand],