bnjbvr / botzilla

Matrix bot tuned for Mozilla's needs
25 stars 7 forks source link

Botzilla

⚠⚠⚠ This project has been deprecated in favor of Trinity, a more advanced bot system written in Rust and making use of commands implemented as WebAssembly modules. No more issues or pull requests will be taken against this repository.

This is a Matrix bot, with a few features, tuned for Mozilla's needs but could be useful in other contexts.

Hack

Make sure that nodejs 10 or more is installed on your machine.

Available modules

See the list. You can refer to a module by its filename in the modules directory.

Admin

A user with a power level greater than 50 (administrator or moderator) can administrate the bot by opening an unencrypted private chat with it, and using the following commands. The super-admin is a username set in the config.json configuration file.

Known keys

Gitlab

Github

Confession

How to create a new module

{
    handler: async function(client, msg) {
        // This contains the message's content.
        let body = msg.body;
        if (body !== '!botsnack') {
            return;
        }

        // This is the Matrix internal room identifier, not a pretty-printable
        // room alias name.
        let roomId = msg.room;

        // This contains the full id of the sender, with the form
        // nickname@domaine.com.
        let sender = msg.sender;

        client.sendText(roomId, `thanks ${sender} for the snack!`);
        client.sendNotice(roomId, "i like snacks!");
    },

    help: "An help message for this module."
}

Deploy

A Dockerfile has been set up to ease local and production deployment of this bot. You can spawn an instance with the following:

docker run -ti \
    -v /path/to/local/config.json:/config.json \
    -v /path/to/local/data-dir:/app/data \
    bnjbvr/botzilla

Community

If you want to hang out and talk about botzilla, please join our Matrix room.

There's also a Matrix room to try the bot features live.