diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/main.rs | 4 | ||||
| -rw-r--r-- | src/util.rs | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs index fb510a1..0a03cfd 100644 --- a/src/main.rs +++ b/src/main.rs @@ -3,6 +3,7 @@ #[macro_use] extern crate error_chain; #[macro_use] extern crate lazy_static; #[macro_use] extern crate cfg_if; +#[macro_use] extern crate dotenv_codegen; extern crate dotenv; extern crate fern; @@ -49,10 +50,11 @@ use errors::*; pub use util::*; lazy_static! { - static ref TARGET_GUILD: u64 = must_env_lookup::<u64>("TARGET_GUILD"); + static ref TARGET_GUILD: u64 = dotenv!("TARGET_GUILD").parse().expect("unable to parse TARGET_GUILD as u64"); static ref TARGET_GUILD_ID: GuildId = GuildId(*TARGET_GUILD); } + struct Handler; impl EventHandler for Handler { fn ready(&self, _: Context, r: Ready) { diff --git a/src/util.rs b/src/util.rs index 9b44bc2..1eb4b23 100644 --- a/src/util.rs +++ b/src/util.rs @@ -23,7 +23,7 @@ lazy_static! { pub static ref OAUTH_URL: Url = Url::parse(
&format!(
"https://discordapp.com/api/oauth2/authorize?scope=bot&permissions={}&client_id={}",
- REQUIRED_PERMS.bits(), env::var("THULANI_CLIENT_ID").expect("client ID was missing. please specify THULANI_CLIENT_ID in env or .env."),
+ REQUIRED_PERMS.bits(), dotenv!("THULANI_CLIENT_ID"),
)
).unwrap();
}
|
