Skip to content

enimatek-nl/small-bot-matrix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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