From f0b9e7b1ba93ebc5ee18c9f451e36eafbd651783 Mon Sep 17 00:00:00 2001 From: array-in-a-matrix Date: Mon, 6 Nov 2023 13:41:23 -0500 Subject: [PATCH] eh --- index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 9b78f5f..40e1aba 100644 --- a/index.js +++ b/index.js @@ -2,6 +2,7 @@ import config from './config.json' assert {type: "json"}; import { MatrixClient, SimpleFsStorageProvider, AutojoinRoomsMixin } from "matrix-bot-sdk"; const storage = new SimpleFsStorageProvider("storage.json"); +client.addPreprocessor(new RichRepliesPreprocessor(false)); const client = new MatrixClient(config.homeserver, config.token, storage); AutojoinRoomsMixin.setupOnClient(client); @@ -11,8 +12,9 @@ client.start().then(() => console.log(`Client has started!`)); client.on("room.message", (roomId, event) => { // ? check if the message's text is not empty and isn't sent by the bot itself if (! event["content"] || event["sender"] === config.user) return; + const message = event["content"]["body"].toLowerCase(); // ? if message starts with the bot's then execute the command - if (event["content"]["body"].toLowerCase().startsWith(config.prefix + "COMMAND")){ + if (message.startsWith(config.prefix + "COMMAND")){ // // TODO: START CODE HERE