It has to be inside the folder of the cargo you have created. Example:
$cargo new discord_bot
discord_bot/.env
You can also add this in the ~/.bashrc or ~/.zshrc as an export.
export DISCORD_TOKEN=mytoken