Skip to content
← Back to Community
How to hide bot token?
Profile icon
DannMunar

I want to share my bot but i dunno how to hide token, anyone free to help? tia :)

Voters
Profile icon
NSteel1
Profile icon
ArcheryAce
Profile icon
SHOYA17
Profile icon
petterhollmes
Profile icon
MioszStaczyk
Profile icon
DannMunar
Comments
hotnewtop
Profile icon
CodingCactus

you can store it in a .env file, which means that no one else can see it

Profile icon
DannMunar

thank you i hid it now :)
@CodingCactus

Profile icon
JanekKocz

i also need help, they removed .env

Profile icon
Saaem07

@JanekKocz Python
Click on Secrets on left side of screen, then give game TOKEN in key and add the token in Value area then go to your discord bot main.py and then import os and then go to last line and type this bot.login(os.environ.get("TOKEN") and run the bot all your problems get solved

Profile icon
CodeLongAndPros
Profile icon
DannMunar

thanks its now hidden :)
@CodeLongAndPros

Profile icon
Saaem07

PYTHON
Click on Secrets on left side of screen, then give game TOKEN in key and add the token in Value area then go to your discord bot main.py and then import os and then go to last line and type this bot.login(os.environ.get("TOKEN") and run the bot all your problems get solved