-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bot frequently stops due to unhandled error event #29
Comments
Interesting, not sure how easy it will be to reproduce. How are you running the bot? Are you passing in an external bot instance? |
I have it set up in the same way as specified in basic usage. If I leave the bot running all the time, it happens once a week when I notice the bot has left the channel because it is killed due to the above error. |
Fair enough, will take a look later today. Meanwhile you might wanna use a process manager like pm2 to automatically restart the bot after it crashes. |
Based on discordjs/discord.js#2523 it seems like maybe |
Did adding |
Do you have an idea about the origin ? |
I'm also having this issue, when using the bot by passing it to an external instance. EDIT: I ran the bot standalone and I am also experiencing these issues:
Then it died. Adding I also tried hooking the node instance to Google Chrome in debugging mode, and nothing new came out of that either. |
It's from the computer/bot going idle, it stops its self from just being on all the time... This may just be discord kicking you offline also from your bot not being used... Try adding a small thing that makes your bot want to always do something like show it typing on a text server every 5 min or so... Also, if this doesn't work try moving your bot to a host (I don't recommend glitch) or buy a Raspberry Pi 3b for like $35 and run it on that... I'm about to make the change to the pi here soon knowing the pi will keep it running.... I don't recommend running your bot on your computer either because you might not have the hardware rated for 24/7 usage like me (my read and write speeds are now cut to a small percentage of what it used to be and the ram was always bad on this computer) Edit/Summary: |
@Gravitygrey already running it on a host so that's not the issue. I mostly got around it using pm2 to restart the bot so for the most part it's not noticeable now, but I don't think that's an actual fix to the issue. |
It's your computer being disconnected from wifi, simple. |
Can we get some light shed on this? This is still a problem for many of us in the community. |
Hi, What you can do is a simple change in Line 364, change the whole function onError(err) to:
Which will force a connection instead of crashing on that error. |
this fixed my problem. I slightly altered mwSora's version -- this.reconnect() errored out for me client.on('error', error => { |
Yes, as other said, after my own investigations and asking a few other devs, this is a problem with Another (less helpful) way to say this is "upstream issue". |
Hi people, can I ask you what are you using the bot for? I think built-in spoiler functionality covers all use cases, or am I missing something? |
The stacktrace contains:
The text was updated successfully, but these errors were encountered: