Skip to main content
Module

x/smallbot_matrix/README.md

Small Matrix Little Bot for Deno
Latest
File

SmallBot

deno doc

Small Matrix Little Bot

Very small implementation (bare essential) to quickly setup a Matrix Bot in Deno/Typescript/Web.

Examples

const client = new SmallBot({
    accessToken: "mysecretaccesstoken",
    homeserverUrl: "https://matrix.org/",
    eventHandler: async (client, roomId, event) => {
        if (event.sender !== client.ownUserId) {
            const profile = await client.getUserProfile(event.sender);
            await client.sendRoomNotice(roomId, profile.displayname + ", you said: <b>" + event.content.body + "</b>");
        }
    }
});

await client.start();

Documentation

View it online at doc.deno.land