Skip to content
← Back to Community
Token
Profile icon
Bumblebee99

Im making a discord bot here on repl, but .env wont do the trick of hiding the token

Answered by KHZ [earned 5 cycles]
View Answer
Voters
Profile icon
Bumblebee99
Comments
hotnewtop
Profile icon
KHZ

@Bumblebee99 Are you naming the .env file like bee.env. If so then you shouldn't do that. You are only supposed to create a file named as .env. No name before the . of the file.

Profile icon
Bumblebee99

@KHZ i named the file .env and it didnt work, it kept giving me errors

Profile icon
KHZ

@Bumblebee99 Can you show the code in the main file.

Profile icon
Bumblebee99

@KHZ ok i mean the code was just
client.run(os.getenv('TOKEN'))

Profile icon
Bumblebee99

@KHZ i got it to work, i was putting in the token in the .env file as TOKEN = ['token here']
Without the token here text ofc

Profile icon
KHZ