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

View file

@ -78,9 +78,18 @@ client.once("ready", function () {
}); });
client.on("error", function () {}); client.on("error", function () {});
rpc.on("ready", function () { rpc.on("connected", function () {
updatePresence(); 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 () {}); rpc.on("error", function () {});
client.on("messageCreate", function (msg) { client.on("messageCreate", function (msg) {