Feat. Adding dotenv to the project and adding the discord token via .env file
This commit is contained in:
parent
380d9cedb0
commit
64c2d46a13
4 changed files with 15 additions and 3 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -1,2 +1,3 @@
|
|||
/target
|
||||
/.idea
|
||||
/.idea
|
||||
.env
|
7
Cargo.lock
generated
7
Cargo.lock
generated
|
@ -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"
|
||||
|
|
|
@ -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"] }
|
||||
|
|
|
@ -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");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue