Every variable arrives under its own name
The variables you add in your bot's settings reach your bot under exactly the same name, unchanged. If your code reads:
client.login(process.env.DISCORD_TOKEN);
add a variable named DISCORD_TOKEN. If it reads process.env.TOKEN, name it TOKEN. When you create your bot we show you the names we found in your code and in .env.example, so you know what to add.
Sensitive values are stored encrypted
Turn on Sensitive for any secret value, such as a token or a password. A sensitive value is stored encrypted and never shown again after you save it; to change it, type a new one. Even if your bot prints it by mistake, we hide it in the console and show •••• instead.
Paste a .env file
Have a .env file on your computer? Paste the whole file into the variables box and we split it line by line.
After you change a variable
The change reaches your bot with the next deployment. Press Redeploy on your bot's page to apply it right away. Variables don't roll back when you roll back to an older deployment; they stay as they are.
Reserved names
Some names belong to Serverk, so you can't add them as variables:
- Any name that starts with
SERVERK_. - The names that carry your deployment settings:
REPO_URL,REPO_REF,REPO_BRANCH,START_COMMAND,INSTALL_COMMAND,ROOT_DIRECTORY,DEPLOYMENT_ID,SNAPSHOT_ID,BOT_PLATFORMandGIT_TOKEN. Change these from your bot's settings instead. BOT_WEB,BOT_PORT_1andBOT_PORT_2, the switches of the web address and the two ports. Turn those on in Manage instead.PATH,HOME,TZ,VIRTUAL_ENVandPYTHONUNBUFFERED, which your bot needs to run.
We give your bot these ourselves:
SERVERK_BOTset to1, andSERVERK_SERVER_CODE, your bot's code.BOT_PLATFORM:discordortelegram.PORT,SERVERK_WEB_URLandSERVERK_WEB_HOSTwhile the web address is on, andSERVERK_PORT_1andSERVERK_PORT_2while that port is on. The guide "Your bot's web address and ports" explains them.
Did this guide help you?
Improve this guide
Guides are open source. Found a fix or an addition? Open a pull request on github.com/serverkgg/bot-node