handle bot commands from unencrypted messages
This commit is contained in:
parent
6389210cf3
commit
e37502972c
14
src/bot.js
14
src/bot.js
@ -364,7 +364,8 @@ class OcrccBot {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// When a facilitator joins a support session, revoke the other invitations
|
// When a facilitator joins a support session, make them a moderator
|
||||||
|
// revoke the other invitations
|
||||||
if (
|
if (
|
||||||
member.membership === "join" &&
|
member.membership === "join" &&
|
||||||
member.userId !== process.env.BOT_USERID &&
|
member.userId !== process.env.BOT_USERID &&
|
||||||
@ -439,13 +440,12 @@ class OcrccBot {
|
|||||||
});
|
});
|
||||||
// unencrypted messages
|
// unencrypted messages
|
||||||
this.client.on("Room.timeline", (event, room, toStartOfTimeline) => {
|
this.client.on("Room.timeline", (event, room, toStartOfTimeline) => {
|
||||||
if (
|
if (event.getType() === "m.room.message") {
|
||||||
event.getType() === "m.room.message" &&
|
logger.log("info", event);
|
||||||
!this.client.isCryptoEnabled()
|
logger.log("info", this.client.isCryptoEnabled());
|
||||||
) {
|
logger.log("info", event.isEncrypted());
|
||||||
if (event.isEncrypted()) {
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
if (event.getType() === "m.room.message" && !event.isEncrypted()) {
|
||||||
this.handleMessageEvent(event);
|
this.handleMessageEvent(event);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user