Require bot prefix env var
This commit is contained in:
parent
e9578dc8d9
commit
08cd434e84
2 changed files with 5 additions and 1 deletions
|
@ -12,3 +12,5 @@ test ModulatingForceBot
|
||||||
`access_token = <oath token>`
|
`access_token = <oath token>`
|
||||||
|
|
||||||
`bot_channels = <chnl1>,<chnl2>`
|
`bot_channels = <chnl1>,<chnl2>`
|
||||||
|
|
||||||
|
`prefix = <prefix>`
|
|
@ -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,
|
||||||
|
|
Loading…
Reference in a new issue