Code Monkey home page Code Monkey logo

mensabot's Introduction

MensaBot - A bot that reminds you of your food in your canteen

This bot sends you a daily reminder of the current food in your canteen (dt. mensa). Additionally, you can use commands to request the listing directly.

Features

  • Schedule daily posts about the food in your canteen
  • Request summary of food in your mensa (at the current date)
  • Change display name per room
  • Simple rights management (only configured admins can interact with the bot)

Functions

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

  1. Get a matrix account for the bot (e.g., on your own homeserver or on matrix.org)
  2. Prepare configuration:
    • Copy config-sample.json to config.json
    • Enter baseUrl to the matrix server and username / password for the bot user
    • Add yourself to the admins (and delete my account from the list :))
    • You can limit the users that can interact with the bot by defining the users list
  3. 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_PATH to point at your config.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

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 help to get an overview about the features of the bot (remember: the bot only respond 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 build 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 that shall be considered has to implement the CanteenAPI. Currently, there is only one implementation for the sw-ka.de interface.

mensabot's People

Contributors

actions-user avatar dependabot[bot] avatar dfuchss avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

mensabot's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.