From 1f2c27fa7e13c1c4e0fed76c8a8aa33341fc100e Mon Sep 17 00:00:00 2001 From: minie4 Date: Sat, 24 Jun 2023 17:15:29 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=91=20Fix=20crash=20when=20sending=20n?= =?UTF-8?q?on-message=20events?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/index.js b/index.js index eef4e70..84a9e1a 100644 --- a/index.js +++ b/index.js @@ -154,6 +154,8 @@ client.on("Room.timeline", async function (event, room) { !(await db.getObjectDefault(`/authStatus/${room.roomId}`, false)) && authPassword ) { + if (event.getType() !== "m.room.message") return; + if (!event.event.content.body.startsWith("login")) { const response = "🔐 Not authenticated! Use login [password] to login";