Ask coding questions

← Back to all posts
Problems with the .env files
CouchPotato1808 (1)

I tried to create a .env file for my repl (I wanted to code a discord bot on my own, but Im pretty new to this kind of thing). When I try to name the new file ".env" it just says "You cannot create .env files anymore, checkout the environment variable sidebar". It's probably stupid,but since I am a complete Newbie and english is not my native language, I wanted to ask.

Coder100 (19280)

.env files are no longer available, please use the new environment secrets which are easier to use.

cuber1515 (94)

@CouchPotato1808 Actually it's not stupid until recently that's how you did it, but there's been an update.

  • STEP 1: click the lock button in the side menu (it should be called Secretes (Environment variables))

  • STEP 2: In the key you put the name of the variable.

  • STEP 3: In the value put the token.
  • STEP 4: click the "add new secrete" button and then click both the insert buttons.

Hope this helps

cuber1515 (94)

Actually I made a "tutorial" on programing discord bots; here it is if you're interested.

CouchPotato1808 (1)

@cuber1515 thank you very much. I actually expected the answer like tomorrow or later. Thanks for the help :)

cuber1515 (94)

@CouchPotato1808 your welcome. It was funny actually I happened to be looking at the ask section of talk and saw this post pop up that very moment and realized I actually knew the answer.