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