Closed niekcandaele closed 5 years ago
Small update:
Today, the bot actually went offline. I saw this message in the logs:
2019-03-11T22:34:11.166Z - info: DISCORD DEBUG - [ws] [connection] Tried to send packet [object Object] but no WebSocket is available!
I'm not sure if it's related to my original issue.
I'm having the same issue on some of my bots, the bot is fine for a few hours then stops sending messages.
Follow up
I noticed that I was GETting a particular role many times in my application, I started caching the response in Redis and I have not seen this problem since. Might be anecdotal...
This has been inactive for quite some time, please reopen if this issue still persists (on master).
Please describe the problem you are having in as much detail as possible:
After some long-ish time (8 hours is the lowest i've seen) the bot stops being able to send messages. As far as I can tell, only sending messages stops working. Every other function I tested still works.
Include a reproducible code sample here, if possible:
I've tried to debug this in several ways but haven't found a solution. After restarting the process, sending messages works as expected so I know that permissions are OK.
I tried the ping command. I see a log message of the bot picking up my command message but no reply.
I enabled debug info from d.js. I see heartbeats succeeding but no other relevant logs.
@botuser eval console.log('test')
@botuser eval console.log(client.channels.get('521825197666467840').id)
@botuser eval client.channels.get('521825197666467840').send('works').then(r => console.log('success - ' + r)).catch(e => console.log('fail - ' + e))
Further details:
I've only seen this happen in the production instance and have not been able to reproduce in a dev environment. Testing on master is not possible because of that.
Thank you!