forked from chalda/DiscordBot
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |