diff --git a/README.md b/README.md index 3b200de..dafeb69 100644 --- a/README.md +++ b/README.md @@ -9,9 +9,10 @@ test ModulatingForceBot ``` login_name = -access_token = +access_token = bot_channels = , prefix = +bot_admins = ``` diff --git a/src/core/identity.rs b/src/core/identity.rs index 0e092e0..61c09dc 100644 --- a/src/core/identity.rs +++ b/src/core/identity.rs @@ -18,12 +18,20 @@ use crate::core::bot_actions::ExecBodyParams; use crate::core::botinstance::{Channel,ChangeResult}; use crate::core::botlog; use crate::core::botmodules::{BotActionTrait, BotCommand, BotModule, ModulesManager}; - use dotenv::dotenv; use std::env; fn adminvector() -> Vec { - vec![String::from("ModulatingForce")] + dotenv().ok(); + let mut admins = Vec::new(); + + if let Ok(value) = env::var("bot_admins") { + for admin in value.split(',') { + admins.push(String::from(admin)) + } + } + + admins }