Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

My bot can't find the .env file and stops running. Help! #46

Open
Spicyraz opened this issue Apr 6, 2020 · 1 comment
Open

My bot can't find the .env file and stops running. Help! #46

Spicyraz opened this issue Apr 6, 2020 · 1 comment

Comments

@Spicyraz
Copy link

Spicyraz commented Apr 6, 2020

When I click run my bot runs for 1 second then just stops running I've read some of the error code (don't really understand it) but I found can't find .env.

@PantheraRed
Copy link

So basically, when you host on Glitch, you must have a file called .env (this file is created by Glitch on the creation of a new express app by default). This file is used to keep certain variables secret. These variables are stored inside an object called env which is stored inside another object called process. You can access your secret variables via process.env.

Here's a reference:
image

Here's how to access your variable:

client.login(process.env.TOKEN);

This means your index.js file doesn't need to look after .env file. If this wasn't the right solution to your question please comment with the error message you're getting (possibly with some references too). 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants