diff --git a/src/main.ts b/src/main.ts index a26a912..546cffa 100644 --- a/src/main.ts +++ b/src/main.ts @@ -151,7 +151,7 @@ const postReplyToStatus = async ( } }; -const ws = createWebsocket(); +let ws = createWebsocket(); ws.on("upgrade", () => { console.log( @@ -170,6 +170,10 @@ ws.on("open", () => { }, 20000); }); +ws.on("pong", (data) => { + console.log(`Pong received: ${JSON.stringify(data.toString("utf-8"))}`); +}); + ws.on("message", async (data) => { try { const message: WSEvent = JSON.parse(data.toString("utf-8"));