🚑 Fix crash when sending non-message events
This commit is contained in:
2
index.js
2
index.js
@ -154,6 +154,8 @@ client.on("Room.timeline", async function (event, room) {
|
|||||||
!(await db.getObjectDefault(`/authStatus/${room.roomId}`, false)) &&
|
!(await db.getObjectDefault(`/authStatus/${room.roomId}`, false)) &&
|
||||||
authPassword
|
authPassword
|
||||||
) {
|
) {
|
||||||
|
if (event.getType() !== "m.room.message") return;
|
||||||
|
|
||||||
if (!event.event.content.body.startsWith("login")) {
|
if (!event.event.content.body.startsWith("login")) {
|
||||||
const response =
|
const response =
|
||||||
"🔐 Not authenticated! Use <code>login [password]</code> to login";
|
"🔐 Not authenticated! Use <code>login [password]</code> to login";
|
||||||
|
Reference in New Issue
Block a user