Skip to content

Commit

Permalink
add auth.js
Browse files Browse the repository at this point in the history
  • Loading branch information
chalda committed Sep 19, 2020
1 parent 581c1bb commit d0ca0f9
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions auth.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
var AuthDetails = {};
try {
AuthDetails = require("./auth.json");
} catch (e){
console.log("Please create an auth.json like auth.json.example with a bot token or an email and password.\n"+e.stack); // send message for error - no token
}

if(!AuthDetails.hasOwnProperty('bot_token')) {
//attempt to populate from ENV variables. useful for remote cloud deploys
AuthDetails = {
bot_token: process.env.bot_token,
client_id: process.env.client_id,
youtube_api_key: process.env.youtube_api_key,
google_custom_search: process.env.youtube_api_key,
imgflip_username: process.env.imgflip_username,
imgflip_password: process.env.imgflip_password,
wolfram_api_key: process.env.wolfram_api_key,
twitch_client_id: process.env.twitch_client_id
}
}

exports.getAuthDetails = () => {
return AuthDetails;
}

0 comments on commit d0ca0f9

Please sign in to comment.