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 (
|
||||
member.membership === "join" &&
|
||||
member.userId !== process.env.BOT_USERID &&
|
||||
@ -439,13 +440,12 @@ class OcrccBot {
|
||||
});
|
||||
// unencrypted messages
|
||||
this.client.on("Room.timeline", (event, room, toStartOfTimeline) => {
|
||||
if (
|
||||
event.getType() === "m.room.message" &&
|
||||
!this.client.isCryptoEnabled()
|
||||
) {
|
||||
if (event.isEncrypted()) {
|
||||
return;
|
||||
if (event.getType() === "m.room.message") {
|
||||
logger.log("info", event);
|
||||
logger.log("info", this.client.isCryptoEnabled());
|
||||
logger.log("info", event.isEncrypted());
|
||||
}
|
||||
if (event.getType() === "m.room.message" && !event.isEncrypted()) {
|
||||
this.handleMessageEvent(event);
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user