Discord bot token: where to find it and keep it safe
Find your Discord bot token, put it into FreeBot safely and create an invite link for your bot.
Where to find the token
- Open the Discord Developer Portal and select your application.
- Click Bot in the menu, then Reset Token, and confirm.
- Copy the token right away. Discord shows it only once.
Where to put it
In the FreeBot panel, open your bot, then Settings, Variables. Paste the token into DISCORD_TOKEN and save. Variables are stored encrypted and passed to your bot when it starts. Restart the bot after a change.
Never put the token in your files
- Anyone with the token can control your bot.
- If you uploaded it to GitHub or shared it, reset it in the Developer Portal and paste the new one into FreeBot.
- Read it in your code with
process.env.DISCORD_TOKEN(Node.js) oros.environ["DISCORD_TOKEN"](Python).
Invite link
In the Developer Portal, open OAuth2, URL Generator, tick bot and applications.commands, pick the permissions and open the generated link to add the bot to your server.