From 8d98581cd98ecbd9a971ec5949b43c51e1c8a692 Mon Sep 17 00:00:00 2001 From: ThePendulum Date: Tue, 18 Jun 2024 23:34:27 +0200 Subject: [PATCH] Fixed any mention of sponges being interpreted as a pong. --- src/schat.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/schat.js b/src/schat.js index d393848..b10a461 100755 --- a/src/schat.js +++ b/src/schat.js @@ -130,6 +130,8 @@ function handleError(error, socket, domain, data) { } } +const pongRegex = /^pong:\d+$/; + async function connect(bot, games) { const socket = { ws: { readyState: 0 }, @@ -154,7 +156,7 @@ async function connect(bot, games) { socket.ws.on('message', async (msgData) => { const msg = msgData.toString(); - if (typeof msg === 'string' && msg.includes('pong')) { + if (typeof msg === 'string' && pongRegex.test(msg)) { logger.debug(`Received pong ${msg.split(':')[1]}`); return; }