matrix-spam-ml

git clone git://archive.git.mtrnord.blog/MTRNord/matrix-spam-ml.git
Log | Files | Refs | Submodules | README | LICENSE

commit 13c0d60e7168d229d2a3323f61bdf66e0f4759e4
parent 051e9debc6b0604a64e1dfd2f29a76c7c2498fc2
Author: MTRNord <mtrnord1@gmail.com>
Date:   Tue, 20 Dec 2022 19:37:49 +0100

Fix roomid pill

Diffstat:
Mbot/src/index.ts | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/bot/src/index.ts b/bot/src/index.ts @@ -131,7 +131,7 @@ class Bot { if (event.messageType !== "m.text") return; // Ignore non-text messages if (roomId !== this.config.adminRoom && roomId !== this.config.warningsRoom) { - await this.checkSpam(event, event.content?.body ?? "", roomId); + await this.checkSpam(event, event.content?.body.trim() ?? "", roomId); } } @@ -151,7 +151,7 @@ class Bot { const displayname = (await (this.client.getUserProfile(mxid) as Promise<MatrixProfileInfo>)).displayname ?? mxid; let alias = roomId; let roomname = roomId; - let room_url = `matrix:roomid/${roomId.replace("!", "")}?via=${this.config.homeserver}`; + let room_url = `matrix:roomid/${roomId.replace("!", "")}?via=${this.config.homeserver.replace("https://", "")}`; try { alias = (await (this.client.getRoomStateEvent(roomId, "m.room.canonical_alias", "") as Promise<CanonicalAliasEventContent>)).alias; roomname = alias;