Environment variables can be defined in .env file instead
This commit is contained in:
parent
27b504012e
commit
dec7cb0236
3 changed files with 8 additions and 5 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -14,4 +14,5 @@ target/
|
|||
/target
|
||||
|
||||
# env
|
||||
.envrc
|
||||
.envrc
|
||||
.env
|
|
@ -5,8 +5,7 @@ test ModulatingForceBot
|
|||
|
||||
## Usage
|
||||
|
||||
Set the following environment variables
|
||||
1. Set the following environment variables ; either on environment variables or in an .env file
|
||||
|
||||
`access_token = <oath token>`
|
||||
|
||||
`bot_channels = <chnl1>,<chnl2>`
|
||||
`bot_channels = <chnl1>,<chnl2>`
|
||||
|
|
|
@ -8,11 +8,14 @@ use twitch_irc::message::ServerMessage;
|
|||
use std::env;
|
||||
use std::time::Instant;
|
||||
use rand::Rng;
|
||||
|
||||
use dotenv::dotenv;
|
||||
// mod helpers;
|
||||
|
||||
#[tokio::main]
|
||||
pub async fn main() {
|
||||
|
||||
dotenv().ok();
|
||||
|
||||
let login_name = "modulatingforcebot".to_owned();
|
||||
let oauth_token = env::var("access_token").unwrap().to_owned();
|
||||
|
||||
|
|
Loading…
Reference in a new issue