Overview
Theforce-post-mensaplan command manually fetches and posts the university cafeteria meal plan (Mensaplan) to the designated channel. This is useful when the automatic posting fails or when you need to post the meal plan outside of the regular schedule.
This command bypasses the normal scheduling system and posts the meal plan immediately.
Command Signature
Parameters
This command takes no parameters.Permissions Required
- MANAGE_GUILD (Manage Server permission)
- Command must be used in a guild (server) context
Usage Examples
Manually post today’s meal plan
What Gets Posted
The command:- Fetches the meal plan image from the configured URL
- Posts the image as
mensaplan.crosspoststhe message (if in an announcement channel) - Updates the database to mark today’s meal plan as posted
mealplan in the bot’s configuration
Format: A PNG image attachment named mensaplan.png
Implementation Details
Source reference:src/commands/administration.rs:174-221
Process Flow
- Fetch the meal plan from the configured URL using
utils::fetch_mensaplan() - Get the current date in
YYYY-MM-DDformat - Post the meal plan image to the configured meal plan channel
- Crosspost the message (publishes to follower channels if announcement channel)
- Update the
mensaplandatabase table to record the post - Confirm success to the command executor
Database Query
The command records the post in the database:Configuration Requirements
This command requires the following configuration values:config.mealplan.url- URL to fetch the meal plan fromconfig.channels.mealplan- Discord channel ID where the meal plan should be postedconfig.roles.mealplannotify- Role to notify (referenced but not actively used in current implementation)
Use Cases
- The automatic meal plan posting failed
- You need to repost the meal plan after a channel cleanup
- Testing the meal plan posting functionality
- Posting the meal plan outside of the regular schedule