Discord bot not coming online

Hey there,

I have a discord bot and it all worked fine but then I removed the token and its not coming back online since I’ve put the token back. Any help would be appreciated

Project:

Could you provide more information like any errors you get in the logs pane?

Heya

I found the problem there was some error in my code. I didn’t reference right to discord’s library. Still thanks for the help tho.

Have a good day!

Hello @DevJoris!

First of all, i highly reccomend you to put your token inside of the .env file, like this TOKEN=your-token-here and you can access it from anywhere from your code by using process.env.TOKEN. With this way strangers cannot access to your bot token from your project unless you add them into it.

It might fix your problem with the bot. If it doesn’t please tell me so i can check the code detailed.

I am using the process.env.TOKEN but my logs say: Cannot find module process.env.TOKEN.
Any help? https://glitch.com/~rainy-ranunculus

Can you accept my request to access youe project so i can help you better?

process.env is a global variable which you dont have to define it on your code.

Just change your login details with this,
client.login(process.env.TOKEN)
and make sure your .env file includes this
TOKEN=your-token-here

1 Like

Already fixed it :smiley: thanks for the help tho

1 Like