I have a Discord bot project with lots of variables (numbers, strings etc). I now use .ENV to store my variables. I would like to change that. I learned that you can use .ENV for sensitive variables. For example (Discord.js), your bot token. I have tried searching online, but couldn't find the right answer. Ideally, I would like to have just one file with all my strings. For example:
botcolor = #ffffff
New:
const botcolor = ./config.js
botcolor = ${botcolor}
A different example with a string (when you do ?ping
)
message.channel.send("Pong!")
New:
const answer = ./config.js
message.channel.send(`${answer}`)
Something like that. I'm not very experienced with JS. So I'm sorry if im not very clear. Since I have multiple bots, I want to have one config file. My bot is like a template, I can add different types of configs, so that the whole bot (color, answers) changes. My bot is on Discord.js v12 btw, since updating would mean almost rewritting my bots.
So does anyone have a solution for an external config file?