diff --git a/.gitignore b/.gitignore index 2bc6dcd..188c46a 100644 --- a/.gitignore +++ b/.gitignore @@ -14,4 +14,5 @@ target/ /target # env -.envrc \ No newline at end of file +.envrc +.env \ No newline at end of file diff --git a/README.md b/README.md index f1df87b..a55b0be 100644 --- a/README.md +++ b/README.md @@ -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 = ` - -`bot_channels = ,` \ No newline at end of file +`bot_channels = ,` diff --git a/src/main.rs b/src/main.rs index 5926d6d..769afb8 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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();