Ask coding questions

← Back to all posts
Token
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
Bumblebee99
Comments
hotnewtop
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.

Bumblebee99

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

KHZ

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

Bumblebee99

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

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

KHZ