Skip to content
← Back to Community
How do I make a .env file for my discord bot (with Discord.js)
Profile icon
Rileymabb

I tried to make a .env file for my discord bot but it doesn't work because I can't make a blank name file on repl. What am I supposed to name the file?

Answered by CodeLongAndPros [earned 5 cycles]
View Answer
Voters
Profile icon
Rileymabb
Comments
hotnewtop
Profile icon
CodeLongAndPros

If you can't add a file via gooey, use:
Ctrl-Shift-s, and enter:

echo 'run="node index.js"' > ./.env
Profile icon
leoxbonner

How do I use the secrets on replit? Ever since .env got removed ive been struggling to make private files.

Profile icon
Scoder12

You name the file .env

Profile icon
Rileymabb

@Scoder12 I can't though, it crashes repl when I try to make a file with a empty name

Profile icon
MrEconomical

^

Profile icon
Scoder12

@Rileymabb I... don't understand. .env isn't an empty string...