diff --git a/index.js b/index.js index 44f2413..6ba5d87 100644 --- a/index.js +++ b/index.js @@ -1,14 +1,13 @@ const { envString, envJSON } = require("./packages/env"); -const env = require("dotenv"); try { global.config = require("./config.json"); } catch (e) { try { - env.config(); + require("dotenv").config(); } catch (e) {} - global.config = envJSON(envString(process.env)); + global.config = envJSON(envString()); } if (!global.config) { diff --git a/packages/env.js b/packages/env.js index db87172..6ac463e 100644 --- a/packages/env.js +++ b/packages/env.js @@ -54,7 +54,9 @@ function envString() { let envString = ''; for (let key in process.env) { - envString += `${key}=${process.env[key]}\n`; + if (key.startsWith("SERVER") || key.startsWith("MUSIC")) { + envString += `${key}=${process.env[key]}\n`; + } } return envString;