Skip to main content

Overview

The force-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

/force-post-mensaplan

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

/force-post-mensaplan
Response:
Mensaplan für 2026-03-04 gepostet

What Gets Posted

The command:
  1. Fetches the meal plan image from the configured URL
  2. Posts the image as mensaplan.crossposts the message (if in an announcement channel)
  3. Updates the database to mark today’s meal plan as posted
Posted in: The channel configured as 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

  1. Fetch the meal plan from the configured URL using utils::fetch_mensaplan()
  2. Get the current date in YYYY-MM-DD format
  3. Post the meal plan image to the configured meal plan channel
  4. Crosspost the message (publishes to follower channels if announcement channel)
  5. Update the mensaplan database table to record the post
  6. Confirm success to the command executor

Database Query

The command records the post in the database:
INSERT INTO mensaplan (date, posted) VALUES ($1, $2) ON CONFLICT DO NOTHING

Configuration Requirements

This command requires the following configuration values:
  • config.mealplan.url - URL to fetch the meal plan from
  • config.channels.mealplan - Discord channel ID where the meal plan should be posted
  • config.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

Troubleshooting

If the command fails, check:
  • The meal plan URL is accessible and returns valid data
  • The bot has permission to post in the configured channel
  • The bot has permission to attach files
  • If using an announcement channel, the bot has permission to crosspost messages

Build docs developers (and LLMs) love