This commit is contained in:
array-in-a-matrix 2023-01-09 16:04:21 -05:00
parent 16f4dcf4b2
commit ff7be36ca6
1 changed files with 1 additions and 2 deletions

View File

@ -5,14 +5,13 @@ const storage = new SimpleFsStorageProvider("storage.json");
const client = new MatrixClient(config.homeserver, config.token, storage);
AutojoinRoomsMixin.setupOnClient(client);
client.start().then(() => console.log(`Client has entered the matrix!`));
client.start().then(() => console.log(`real`));
client.on("room.message", (roomId, event) => {
if (!event["content"] || event["sender"] === config.user) return;
try {
if (event["content"]["body"].toLowerCase().includes("real")) {
client.replyText(roomId, event, "real")
// console.log("real => roomId: " + roomId + " author: " + event["sender"] + " message: " + event["content"]["body"])
console.table([roomId, event["sender"], event["content"]["body"]])
}
} catch (error) {