diff --git a/.gitignore b/.gitignore index 40d9aca..5e101cc 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /target -/.idea \ No newline at end of file +/.idea +.env \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index f56dce9..da8b88d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -220,6 +220,7 @@ checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" name = "count_bot" version = "0.1.0" dependencies = [ + "dotenv", "serenity", "tokio", ] @@ -318,6 +319,12 @@ dependencies = [ "syn 2.0.91", ] +[[package]] +name = "dotenv" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77c90badedccf4105eca100756a0b1289e191f6fcbdadd3cee1d2f614f97da8f" + [[package]] name = "encoding_rs" version = "0.8.35" diff --git a/Cargo.toml b/Cargo.toml index 916ccd8..45e4a89 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,5 +4,6 @@ version = "0.1.0" edition = "2021" [dependencies] +dotenv = "0.15.0" serenity = "0.12.4" tokio = { version = "1.42.0", features = ["full"] } diff --git a/src/main.rs b/src/main.rs index e7a11a9..c906f16 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,3 +1,6 @@ -fn main() { - println!("Hello, world!"); +use dotenv::dotenv; +#[tokio::main] +async fn main() { + dotenv().ok(); + let token = std::env::var("TOKEN").expect("TOKEN must be set"); }