parent
b55650b221
commit
ee0c8f0987
4 changed files with 124 additions and 37 deletions
|
@ -31,6 +31,7 @@ pub struct Config {
|
|||
// tokens for discord and other API's
|
||||
pub discord_token: String,
|
||||
pub discord_token_minecraft: String,
|
||||
pub minecraft_mcprofile: String,
|
||||
|
||||
// email settings
|
||||
pub mail_smtp: String,
|
||||
|
@ -58,6 +59,7 @@ pub fn get_config() -> Config {
|
|||
let mut config = Config {
|
||||
discord_token: "".to_string(),
|
||||
discord_token_minecraft: "".to_string(),
|
||||
minecraft_mcprofile: "".to_string(),
|
||||
|
||||
home: ".".to_string(),
|
||||
database: "database.db".to_string(),
|
||||
|
@ -82,6 +84,9 @@ pub fn get_config() -> Config {
|
|||
if let Ok(x) = env::var("DISCORD_TOKEN_MINECRAFT") {
|
||||
config.discord_token_minecraft = x.trim().to_string();
|
||||
}
|
||||
if let Ok(x) = env::var("MINECRAFT_MCPROFILE_KEY") {
|
||||
config.minecraft_mcprofile = x.trim().to_string();
|
||||
}
|
||||
|
||||
if let Ok(x) = env::var("EMAIL_SMTP") {
|
||||
config.mail_smtp = x.trim().to_string();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue