From 976da7257b4250febf5e87c32807f6d4c127816a Mon Sep 17 00:00:00 2001 From: Chris Plaatjes Date: Wed, 22 Feb 2023 18:00:11 -0500 Subject: [PATCH] Removed, using typescript --- index.js | 26 -------------------------- 1 file changed, 26 deletions(-) delete mode 100644 index.js diff --git a/index.js b/index.js deleted file mode 100644 index 02194ca..0000000 --- a/index.js +++ /dev/null @@ -1,26 +0,0 @@ -const sdk = require("matrix-bot-sdk"); -const MatrixClient = sdk.MatrixClient; -const SimpleFsStorageProvider = sdk.SimpleFsStorageProvider; -const AutojoinRoomsMixin = sdk.AutojoinRoomsMixin; - -const homeserverUrl = ""; -const accessToken = ""; - -const storage = new SimpleFsStorageProvider("config/bot.json"); - -const client = new MatrixClient(homeserverUrl, accessToken, storage); -AutojoinRoomsMixin.setupOnClient(client); - -client.start().then(() => console.log("Client started!")); - -client.on("room.message", (roomId, event) => { - if (! event["content"]) return; - const sender = event["sender"]; - const body = event["content"]["body"]; - console.log(`${roomId}: ${sender} says '${body}`); -}); - -client.sendMessage(roomId, { - "msgtype": "m.text", - "body": "This is message text.", -}); \ No newline at end of file