My Discord Bot project won't load at all, no errors

So once upon a today, I went to edit my discord bot project known as dogetron-discordbot. I added some stuff then refreshed the bot. It stopped working. I’m refreshing and refreshing, but it doesn’t work. There are no error messages, just loading. The output looks similar to this:

Your app is listening on port 1988.
Attempting to load command kick. <== (That’s my discord bot command handler)

And nothing else.

Can you send your project link?

Hey @cybertelx, it looks to me like you’re overriding your project’s port. You should just use process.env.PORT and remove any overrides you have to make sure you’re always connecting to the port that Glitch is currently listening for. That in itself might enable your bot to connect; while your project’s not listening to the correct port Glitch will continually try to restart your application.

There are some errors further up in your logs, but I don’t see anything further indicating that your command isn’t loaded.

I’ve changed the things that require ports to use process.env.PORT but now it just doesn’t say anything.

Hi @cori, this seems to be the same problem my project is having now (framexr.glitch.me) Curious for any tips here on figuring this out. @cori_testing

Make sure all ports that are using the glitch project’s link are at 3000 because that is the port that Glitch uses!
@gabrieljbaker @cybertelx

@Callum-OKane Thanks so much! I set process.env.PORT from 1988 to 3000!

No problem, just make sure to mark the message as solution so others can see the fix if they ever have the same problem!

Just to be clear here, you shouldn’t need to override your project’s PORT in .env at all. Glitch will set that environment variable to the one that’s expected on its own unless it’s overriden. There are a few situations where 3000 isn’t the correct port, and overriding it in .env will mean that your project won’t respond if you do get into one of those conditions (the most common one is when the Debugger is active).

That said, glad it’s working for you!

My discord bot won’t transfer. It just shows the loading disc and a light gray background.

Hi, please create your own topic with relevant info like project name. We can’t help you with that minimal description, and please please please don’t bump old topics unless they’re directly related to your problem i.e. exact same errors, exact same project etc. Thanks!

1 Like