Skip to content

Commit 316c808

Browse files
committed
make github happy
1 parent 28a1801 commit 316c808

File tree

4 files changed

+11
-39
lines changed

4 files changed

+11
-39
lines changed

Cargo.lock

Lines changed: 1 addition & 30 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ edition = "2021"
99
serde = { version = "1.0.126", features = ["derive"] }
1010
serde_json = "1.0.96"
1111
tokio = { version = "1.27.0", features = ["full"] }
12-
dotenv_codegen = "0.15.0"
1312
async-trait = "0.1.68"
1413
discord = { path = "discord" }
1514
futures-util = "0.3.28"
1615
monostate = "0.1.6"
1716
ini = "1.3.0"
1817
rand = "0.8.5"
18+
dotenv = "0.15.0"
1919

2020
[patch.crates-io]
2121
serde = { git = "https://github.com/Astavie/serde.git", branch = "integer-tags-for-enums-noprecompile" }

discord/src/gateway.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,8 @@ struct ConnectionProperties {
185185

186186
#[derive(Deserialize, Debug)]
187187
pub struct Ready {
188-
resume_gateway_url: String,
189-
session_id: String,
188+
_resume_gateway_url: String,
189+
_session_id: String,
190190
}
191191

192192
#[derive(Serialize, Debug)]

src/main.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
#![feature(exhaustive_patterns)]
44
#![feature(adt_const_params)]
55

6-
use std::println;
6+
use std::{env, println};
77

88
use async_trait::async_trait;
99
use discord::command::{Param, StringOption};
1010
use discord::interaction::{AnyInteraction, InteractionResource, MessageComponent, Webhook};
1111
use discord::request::Discord;
1212
use discord::user::{self, User};
13-
use dotenv_codegen::dotenv;
13+
use dotenv::dotenv;
1414
use futures_util::StreamExt;
1515
use game::{Flow, Game, GameMessage, GameUI, InteractionDispatcher, Logic};
1616

@@ -28,9 +28,6 @@ use crate::cah::CAH;
2828
mod cah;
2929
mod game;
3030

31-
const RUSTMASTER: &str = dotenv!("RUSTMASTER");
32-
const CARDMASTER: &str = dotenv!("CARDMASTER");
33-
3431
async fn purge(commands: Commands, client: &Discord) -> Result<()> {
3532
if let Ok(commands) = commands.get(client).await {
3633
for command in commands {
@@ -105,8 +102,12 @@ impl Game for TestGame {
105102
}
106103

107104
async fn run() -> Result<()> {
105+
// load dotenv
106+
dotenv().unwrap();
107+
let token = env::var("CARDMASTER").expect("Bot token CARDMASTER must be set");
108+
108109
// connect
109-
let client = Discord::new(CARDMASTER);
110+
let client = Discord::new(token);
110111
let application = application::Me.get(&client).await?;
111112

112113
// list guilds

0 commit comments

Comments
 (0)