mensabot
A bot that reminds you of your food in your mensa
mensabot sends you a daily reminder of the current menu in your canteen (German: mensa). Additionally, you can use commands to request the listing directly.
Features
- Schedule daily posts about the food in your canteen
- Request a summary of the food in your mensa for the current date
- Change display name per room
- Simple rights management (only configured admins can interact with the bot)

Supported APIs
This bot aims to support multiple canteen APIs. For details about the implementation, take a look at Development.
Currently, the bot supports the following mensa:
Setup
- Get a matrix account for the bot (e.g., on your own homeserver or on
matrix.org) - Prepare configuration:
- Copy
config-sample.jsontoconfig.json - Enter
baseUrlto the matrix server andusername/passwordfor the bot user - Add yourself to the
admins(and delete my account from the list :))
- Copy
- Either run the bot via jar or run it via the provided docker.
- If you run it locally, you can use the environment variable
CONFIG_PATHto point at yourconfig.json(defaults to./config.json) - If you run it in docker, you can use a command similar to this
docker run -itd -v $LOCAL_PATH_TO_CONFIG:/usr/src/bot/data/config.json:ro ghcr.io/dfuchss/mensabot
- If you run it locally, you can use the environment variable
Usage
- An admin can invite the bot to an unencrypted room. If the room has enabled encryption or if the invite was not sent by an admin, the bot ignores it (without logging it)
- After the bot has joined, use
!mensa helpto get an overview of the features of the bot (remember: the bot only responds to admin users) - In order to get daily notifications about the food in your canteen, simply use
!mensa subscribe. This command will print the room id of the current room into the channel. Add this channel to the list in the config and restart the bot.
Development
I’m typically online in the trixnity channel. So feel free to tag me there if you have any questions.
- The bot is built using the trixnity framework.
- The basic functionality is located in Main.kt. There you can also find the main method of the program.
- Every canteen to be supported has to implement the
CanteenAPI. Currently, there is only one implementation for the sw-ka.de interface.