import config from './config.json' assert {type: "json"}; import { MatrixClient, SimpleFsStorageProvider, AutojoinRoomsMixin } from "matrix-bot-sdk"; const storage = new SimpleFsStorageProvider("storage.json"); const client = new MatrixClient(config.homeserver, config.token, storage); AutojoinRoomsMixin.setupOnClient(client); client.start().then(() => console.log(`real`)); client.on("room.message", (roomId, event) => { if (!event["content"] || event["sender"].includes("_bot:")) return; try { if (event["content"]["body"].toLowerCase().includes("real")) { client.replyText(roomId, event, "real") console.table([roomId, event["sender"], event["content"]["body"]]) } } catch (error) { console.error("Ran into an error:\n" + error) } })