discord-rich-presence
discord-rich-presence copied to clipboard
Closing Discord, unhandled promise rejection
If closing Discord, this ends up in an unhandled promise rejection. Could this please be changed so it could be handled, in order to retry initializing it after it was closed?
Try listening for the error
event like this:
const client = require('discord-rich-presence')('180984871685062656');
client.on('error', err => {
console.log(`Error: ${err}`);
});
Try listening for the
error
event like this:const client = require('discord-rich-presence')('180984871685062656'); client.on('error', err => { console.log(`Error: ${err}`); });
We can't handle error with this. The code stop running after that
This can only account for errors in the init. Otherwise you will still get
(node:16829) UnhandledPromiseRejectionWarning: Error: connection closed
if you close Discord while running.