Discord Bot not starting

Hello guys, noob question.

Earlier today my bot was logging in fine to discord, but now it won’t log in. I am calling client.login and have a token in my .env file.

Any help appreciated

Link to project

Hello there!
You can try making a settings.json file and add

  "token": "token here",

Then in index.js at the first line add const settings = require("./settings.json"); and on the bot main .js file type client.login(settings.token);

I hope this helps!

Also make sure to make your project private, so no one steals your token.

1 Like

Run this in the terminal and post the results here.

curl -I https://discordapp.com/api/v7/gateway

These are the results @DavidJoacaRo

HTTP/1.1 429 Too Many Requests
Date: Wed, 03 Jun 2020 20:36:16 GMT
Content-Type: text/plain; charset=UTF-8
Content-Length: 16
Connection: close
Retry-After: 54015
X-Frame-Options: SAMEORIGIN
Cache-Control: private, max-age=0, no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Expires: Thu, 01 Jan 1970 00:00:01 GMT
Set-Cookie: __cfduid=d8948e9f5afcfdccec3426860a5c350861591216576; expires=Fri, 03-Jul-20 20:36:16 GMT; path=/; domain=.discordapp.com; HttpOnly; SameSite=Lax
cf-request-id: 031d7f30e60000e0ee2f9b2200000001
Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
Server: cloudflare
CF-RAY: 59dc3494accde0ee-IAD

Your host was banned. Post your project name on the Mega-Thread.