add reconnect logic to rich presence

This commit is contained in:
Cynthia Foxwell 2022-10-02 13:17:31 -06:00
parent 1eeaec78e3
commit 9dc3f1276d
1 changed files with 10 additions and 1 deletions

View File

@ -78,9 +78,18 @@ client.once("ready", function () {
});
client.on("error", function () {});
rpc.on("ready", function () {
rpc.on("connected", function () {
updatePresence();
});
rpc.once("ready", function () {
rpc.transport.on("close", async function () {
try {
await rpc.transport.connect();
} catch (err) {
rpc.transport.emit("close");
}
});
});
rpc.on("error", function () {});
client.on("messageCreate", function (msg) {