Anyone know how to use .env?(discord.py)
tristandasavage

I'm trying to hide my token in a .env file so people can't get my bot's token, and I don't know how to get my token variable from the file.
ENV:
TOKEN=da token(not telling u lol)
PYTHON:
token = os.getenv("TOKEN")

I have a feeling that my code is wrong, but I don't know what the right code is.

You are viewing a single comment. View All
Answered by AloegelhiPlaysR [earned 5 cycles]
View Answer
EpicRaisin

@luigirandoli Repl.it changed the system so now you don't need to make a file. Instead, you just go to the Secrets tab (the one with the lock) to make secrets, and it'll still work with the same code.