La Nonna is our matrix bot
Find a file
2024-03-25 15:13:36 +01:00
jellyfin-fml readme 2024-03-25 15:13:36 +01:00
lanonna due bot 2024-03-25 15:01:17 +01:00
pam pam 2024-03-25 14:17:34 +01:00
.gitignore more files 2024-03-16 09:33:43 +01:00
LICENSE Initial commit 2024-03-16 09:20:34 +01:00
README.org more files 2024-03-16 09:33:43 +01:00

La Nonna

La Nonna is a matrix bot that we use on the goulash.lezzo.org matrix server.

It's an appreciation to our dear grandmothers who spent so much time with us, caring even about the smallest things.

How it works

The La Nonna bot always accepts invites to a matrix channel. It listens to commands in the irc format, starting with '!' and followed by a lowercase word. Every time La Nonna receives a sentence starting with the command token it splits it into two parts, the command keyword and the arguments. See lanonna/commands.py for the parsing routine.

La Nonna sends the parsed message to the default exchange of a RabbitMQ instance, using as routing key the command keyword. The message has the following JSON format, as you can see from lanonna/protocol.py:

    command: str
    content: str
    source_message_id: str
    sender_nick: str
    room_id: str

La Nonna has a static list of commands keyword that are accepted and then forwarded to RabbitMQ. For every other keyword not in this list, a help message is sent to the originating matrix channel.

La Nonna expects other software from this repo to consume the message from RabbitMQ. La Nonna consumes messages from the "lanonna" exchange and expects messages in this format, as you can see from lanonna/protocol.py:

    content: str
    source_message_id: str | None
    room_id: str
    as_reply: bool  # requires source_message_id
    as_markdown: bool

Configuration

La Nonna and every other RabbitMQ consumer in this repo, will read a single configuration file named /etc/lanonna.toml that contains a subsection for every RabbitMQ consumer.

Example configuration file:

[lanonna]
matrix_url = "https://matrix.example.org"
matrix_username = "@lanonna:matrix.example.org"
matrix_password = "theol'days"
mq_url = "amqp://rabbitmq:rabbitmq@rabbimq.example.org/"
[pam]
forgejo_base64 = "dGhlb2wnZGF5cwo="
mq_url = "amqp://rabbitmq:rabbitmq@rabbitmq.example.org/"