Compare commits
3 commits
Author | SHA1 | Date | |
---|---|---|---|
array-in-a-matrix | b9504cc6a1 | ||
9662133052 | |||
47f3a708b7 |
8
index.js
8
index.js
|
@ -5,13 +5,13 @@ const storage = new SimpleFsStorageProvider("storage.json");
|
||||||
const client = new MatrixClient(config.homeserver, config.token, storage);
|
const client = new MatrixClient(config.homeserver, config.token, storage);
|
||||||
|
|
||||||
AutojoinRoomsMixin.setupOnClient(client);
|
AutojoinRoomsMixin.setupOnClient(client);
|
||||||
client.start().then(() => console.log(`real`));
|
client.start().then(() => console.log(`based`));
|
||||||
|
|
||||||
client.on("room.message", (roomId, event) => {
|
client.on("room.message", (roomId, event) => {
|
||||||
if (!event["content"] || event["sender"] === config.user) return;
|
if (!event["content"] || event["sender"].includes("_bot:")) return;
|
||||||
try {
|
try {
|
||||||
if (event["content"]["body"].toLowerCase().includes("real")) {
|
if (event["content"]["body"].toLowerCase().includes("base")) {
|
||||||
client.replyText(roomId, event, "real")
|
client.replyText(roomId, event, "based on what?")
|
||||||
console.table([roomId, event["sender"], event["content"]["body"]])
|
console.table([roomId, event["sender"], event["content"]["body"]])
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|
Loading…
Reference in a new issue