Skip to content
This repository has been archived by the owner on Sep 13, 2024. It is now read-only.
/ Eugen Public archive

Discord KUSSS management bot

License

Notifications You must be signed in to change notification settings

MrMinemeet/Eugen

Repository files navigation

Eugen

Eugen is the successor to the sadly abandoned Kilian Discord Bot. After facing some issues with the old codebase, we decided to start from scratch and build a new bot in a more suited and modern language that is based on the JVM. Eugen is written in Kotlin instead of Python and should provide the same features and fix some issues that were present in Kilian.

So what does Eugen do?

Well, Eugen manages course channels based on KUSSS data like a good old restaurant under the sea 😉. This means that he creates channels for every course a user attends attend and assigns them using member permissions. Another perk of using Eugen is that a user can join a course channel with a simple command.

With all this automation you don't have to focus on managing your server and can focus on the important things in life, such as "studying", sleeping or making memes.

Usage

Note: Commands marked with a ' 🦺 ' are only available to users added in the managers.txt file.

/sleep 🦺

Gracefully puts Eugen to sleep. All remaining queued messages are sent before turning off.

/kusss <url> [mat-nr]

Subscribes the user to the Eugen Service.

  • The url is the link to the calendar file of KUSSS. The data is fetched, parsed and used to assign the corresponding LVA channels.
  • The optional mat-nr is the student's matriculation number. At this point it is optional but may be useful to know at some occasion.

/unkusss

Unsubscribes the user from the Eugen Service. Furthermore, any user-specific data stored is deleted.

/matnr <@user>

Retrieves the matriculation number of the user. This is only possible if the user is subscribed to the Eugen Service and stated their matriculation number.

/reload 🦺

Reloads the data from the calendar file. This action is also performed automatically every 24 hours.

/delete-kusss 🦺

Deletes the KUSSS category and all it's channels. 🚨 This action is irreversible.

/join <course-id>

Allows the users to join a course channel they don't attend. This is useful for students who already passed the course but want to stay in the channel to help others. The course-id is the ID of the course.

/leave <course-id>

Allows the user to leave a course channel. This can be a channel they joined manually or a channel they were assigned to by Eugen. The course-id is the ID of the course.

Differences to Kilian

  • /reload command to manually reload the calendar file and automatic reload every 24h.
  • Created channels under the KUSSS category are sorted by their name in ascending order.
  • Places KUSSS url into the channel topic.
  • No explicit /ping command in order to mention specific users. The roles are channel based and therefore a normal @everyone or @here inside the channel is sufficient.
  • No issue with API rate limits

How to get a working discord bot

Requirements

The bot delivers all major dependencies in the form of a fat jar. The only requirement is a JRE.

Create a bot account

  1. Create a new bot by following THIS guide. Please store your token in a safe place, as you will need it later.
  2. Set all boxes in "Privileged Gateway Intents" ("Bot" page) to "on".
  3. Use the URL Generator to create an invitation link for the bot.
    • Check bot and applications.commands under "Scopes"
    • Check Administrator under "Bot Permissions" (this is the easiest way. You can also set the permissions manually but this is not covered here)
  4. Use the link at the bottom of the page to invite the bot to your server.

Get the bot running

  1. Download the latest release from HERE.
  2. Extract the archive.
  3. Create a file called managers.txt and add your unique discord username (the name that replaced the name#number) to it.
  4. Set the previously received token as the environment variable EUGEN_BOT_TOKEN.g
  5. Start the bot by executing the downloaded .jar file with java -jar eugen-<version>.jar. This should start the bot and you should see Eugen being online in your server.

Future Plans

  • Notify new users about the bot's existence and how to use it. (See send_user_join_info branch)
  • Handle more than 50 courses, as the current limit is 50 channels per category. Solution: Split the courses into multiple same-sized categories.
  • Better handling of exam dates, currently simply parses the next exam date from users registered to the course, which causes issues if no user is registered to the exam.

Missing Semester

Members:

  • Alexander Voglsperger - k12005568
  • Bernhard Schertler - k12006715

Publishing

If desired, you can publish it on the website or just link to the public GitHub repository.