Skip to content

Commit 8b853db

Browse files
committed
Allow using dotenv for setup
1 parent 1926b14 commit 8b853db

5 files changed

Lines changed: 14 additions & 1 deletion

File tree

.env_template

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
DISCORD_TOKEN=
2+
GITHUB_TOKEN=

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
result
44
target/
55
state.json
6+
.env

Cargo.lock

Lines changed: 8 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,4 @@ reqwest = "0.11.22"
2323
hex = "0.4.3"
2424
to-arraystring = "0.1.3"
2525
arrayvec = "0.7.4"
26+
dotenvy = "0.15.7"

src/main.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ async fn on_error(error: poise::FrameworkError<'_, Data, Error>) {
6868

6969
#[tokio::main]
7070
async fn main() {
71+
let _ = dotenvy::dotenv();
72+
7173
let discord_token = env::var("DISCORD_TOKEN").expect("Expected discord api token");
7274
let github_token = env::var("GITHUB_TOKEN").expect("Expected github api token");
7375

0 commit comments

Comments
 (0)