mirror of
https://github.com/informaticker/discord-jellyfin-bot.git
synced 2024-11-23 18:21:55 +01:00
15 lines
807 B
JavaScript
15 lines
807 B
JavaScript
const fs = require("fs");
|
|
const filename = "./config.json";
|
|
const configfile = require(filename);
|
|
|
|
if (!configfile["discord-prefix"]) { configfile["discord-prefix"] = process.env.DISCORD_PREFIX; }
|
|
if (!configfile.token) { configfile.token = process.env.DISCORD_TOKEN; }
|
|
if (!configfile["server-adress"]) { configfile["server-adress"] = process.env.JELLYFIN_SERVER_ADDRESS; }
|
|
if (!configfile["jellyfin-username"]) { configfile["jellyfin-username"] = process.env.JELLYFIN_USERNAME; }
|
|
if (!configfile["jellyfin-password"]) { configfile["jellyfin-password"] = process.env.JELLYFIN_PASSWORD; }
|
|
if (!configfile["jellyfin-app-name"]) { configfile["jellyfin-app-name"] = process.env.JELLYFIN_APP_NAME; }
|
|
|
|
fs.writeFile(filename, JSON.stringify(configfile, null, 1), (err) => {
|
|
if (err) return console.log(err);
|
|
});
|