Bot admins in env file #22

Merged
modulatingforce merged 7 commits from haru_test into master 2024-04-09 13:48:55 -04:00
2 changed files with 12 additions and 3 deletions

View file

@ -9,9 +9,10 @@ test ModulatingForceBot
```
login_name = <botname>
access_token = <oath token>
access_token = <oauth token>
bot_channels = <chnl1>,<chnl2>
prefix = <prefix>
bot_admins = <admins>
```

View file

@ -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<String> {
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
}