Require bot prefix env var

This commit is contained in:
ModulatingForce 2023-12-20 19:22:45 -05:00
parent e9578dc8d9
commit 08cd434e84
2 changed files with 5 additions and 1 deletions

View file

@ -12,3 +12,5 @@ test ModulatingForceBot
`access_token = <oath token>` `access_token = <oath token>`
`bot_channels = <chnl1>,<chnl2>` `bot_channels = <chnl1>,<chnl2>`
`prefix = <prefix>`

View file

@ -53,6 +53,7 @@ impl BotInstance {
// let login_name = "modulatingforcebot".to_owned(); // let login_name = "modulatingforcebot".to_owned();
let login_name = env::var("login_name").unwrap().to_owned(); let login_name = env::var("login_name").unwrap().to_owned();
let oauth_token = env::var("access_token").unwrap().to_owned(); let oauth_token = env::var("access_token").unwrap().to_owned();
let prefix = env::var("prefix").unwrap().to_owned().chars().next().expect("ERROR : when defining prefix");
/* /*
Vector of channels to join Vector of channels to join
@ -81,7 +82,8 @@ impl BotInstance {
let mut b = BotInstance { let mut b = BotInstance {
prefix : '>', //prefix : '>',
prefix : prefix,
bot_channel : login_name , bot_channel : login_name ,
// tclient : TwitchClient { incoming_messages , client }, // tclient : TwitchClient { incoming_messages , client },
incoming_messages : incoming_messages, incoming_messages : incoming_messages,