Discord.js bot will not login to client user; why?
EDIT: This is a replit IP ratelimit. nothing you can do
So I have a Discord bot, and it's been working just fine. I've had it running for 28 days now, and it's done just fine. But now, for random periods of time, it stops responding to the client and when I restart it the client never logs in and never fires the
ready event. I have no idea why this is happening, and I'm worried that this might be a rate limit. But at the same time, I have another instance going that is exclusively for music commands, but that is working just fine, so it can't be an issue with a rate limit or bad token.
Don’t run two instances of your bot, first of all. Discord.js won’t be able to communicate ratelimits across the instances. Secondly, you’ll want to kill the bot’s repl container when there’s an IP rate limit from discord. Something as simple as listening to the client’s debug event for “429 on /client/login” or something, and then use the child_process module to run the “kill 1” command.