diff --git a/config.sample.toml b/config.sample.toml index 11a626d..5fafb8d 100644 --- a/config.sample.toml +++ b/config.sample.toml @@ -1,4 +1,6 @@ -DISCORD_TOKEN="the discord bot token" -SPOTIFY_USERNAME="your spotify email" -SPOTIFY_PASSWORD="your spotify password" -DISCORD_USER_ID="your discord id here" +# you will have to insert your own values here + +DISCORD_TOKEN="Mjk3ODQzNDgzNzgzODU2MjMw.SxDNko.UOdRWlDuz_lFrTOeQWEuzKGBmDFdVTGns3jd4o" +SPOTIFY_USERNAME="mail@example.com" +SPOTIFY_PASSWORD="MySpotifyPassword" +DISCORD_USER_ID=301780655019130880 diff --git a/src/lib/config.rs b/src/lib/config.rs index a538969..df79a8c 100644 --- a/src/lib/config.rs +++ b/src/lib/config.rs @@ -5,11 +5,14 @@ use figment::{ use serde::{Deserialize}; #[derive(Deserialize, Clone)] -#[serde(rename_all = "SCREAMING_SNAKE_CASE")] pub struct Config { + #[serde(alias = "DISCORD_TOKEN")] pub discord_token: String, + #[serde(alias = "SPOTIFY_USERNAME")] pub spotify_username: String, + #[serde(alias = "SPOTIFY_PASSWORD")] pub spotify_password: String, + #[serde(alias = "DISCORD_USER_ID")] pub discord_user_id: u64, } @@ -17,7 +20,7 @@ impl Config { pub fn new() -> Result { let config: Config = Figment::new() .merge(Toml::file("config.toml")) - .merge(Env::raw().map(|v| v.to_string().to_lowercase().into())) + .merge(Env::raw()) .extract()?; Ok(config) }