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


#1

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.


#2

Can you send your project link?


#3

Hey @TrueCodeFusionX, 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.


#4

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


#5

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


#6

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


#7

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


#8

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


#9

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!