diff --git a/main.js b/main.js index 8e94081..31fe61f 100644 --- a/main.js +++ b/main.js @@ -502,6 +502,11 @@ client.on("Room.timeline", function (event, room) { return; } + if (event.getTs() < (Date.now() - 1000 * 60 * 60 * 8)) { + // Ignore old events (8 hrs), they're probably duplicates or something. + return; + } + if (event.getContent().body.toLowerCase().startsWith("!sms")) { // capture command to start room for new number const matches = event.getContent().body.match(/([1-9]?[0-9]{10})/g);