Ask coding questions

← Back to all posts
Keep Discord Bot Token Hidden
CT2224 (144)

How do you keep a Discord Bot Token a secret?

Answered by PattanAhmed (1397) [earned 5 cycles]
View Answer
PattanAhmed (1397)

@CT2224 Hi,
Yeah, I know.
The main part of making a Discord bot is storing the tokens.
The also has the ability to keep your tokens safe and secure only when you create a file called .env and save the data there.

No one can access it even when they Fork or Download the Repl.
Read this docs for more info:-

That's it

Hope this helps!

realTronsi (906)

use an .env file, @RYANTADIPARTHI suggestion will not work

EpicGamer007 (1607)

Just use a .env file, i do not think you need to encrypt it