How to deploy a Discord.JS bot on Glitch? [ISSUE RESOLVED]

Wait, I have reason to suspect that your Debugger is still active…

It may be showing it, but the bot itself doesn’t seem to be working…

Can you check if the Debugger is still running? If it is, can you stop the Debugger?

1 Like

Also, did you add the bot’s token into the .env file?

Yeah, I got it stopped

1 Like

Yes, I did, that’s true

Hmm… I guess we can check if you bot if banned from discord. Do you have anymore error in the logs?

I think I know why…

1 Like

Nope, no way my bot is banned :slight_smile:

Its possible. Glitch containers can get banned.

I think I found it! @JoshJson, can you paste the following code at the bottom of index.js?

const listener = app.listen(process.env.PORT || 3000, () => {
   console.log("Your app is listening on port " + listener.address().port);
});
2 Likes

In index.js, not express.js! And I made a small edit to the above code.

This line might also have something to do with it.
bot.login(token)

1 Like

No, I know what the error is. I made a small edit to the code I posted above, using it should fix it.

Now the error is about defining Express.

Now it should work.  

1 Like

Hey, if you are still up to helping, can you DM me your discord at @JoshJson , I didn’t realise there were limits on replies

Hey what’s up. Can you hit me up on discord, DM me at @JoshJson . Didn’t know that reply limit was a thing lol

1 Like

@JoshJson join this Discord server so that we’ll be able to help you:

3 Likes