A meal recommender discord bot for Truman Students Dining at Missouri and Ryle Hall
- Real-time Menu Integration – Fetches and parses live daily menus from Missouri and Ryle Dining Halls.
- Automated Dietary Filtering – Automatically excludes items based on user's diet restrictions in profile (eg: Vegan, Lactose Intolerance etc...).
- Gemini AI Recommendations – Leverages Google’s Pro model to suggest optimal meal combinations within given filtered menu
- Nutritional Profiling – Calculates users BMR and TDEE using the Mifflin-St Jeor Equation and finds optimal caloric consumption per day
- Supports Meal Splitting – Supports custom caloric distributions like Balanced, Skip Breakfast, or Heavy Dinner.
- Data Management – Uses Supabase (PostgreSQL) for secure storage of user physical stats and health constraints.
- Asynchronous Cog Architecture – Built with
discord.pyCogs andasynciofor non-blocking database and API operations. - Interactive Multi-Step Signup – Employs a robust
discord.uiView system with validation for sign ups.
TruMeals uses slash commands to provide a clean and interactive experience. Here is a breakdown of what you can do:
- Link your Discord account to the TruMeals database and set up your nutritional profile.
- Launches a multi-step interface to collect age, weight, height, and activity levels.
- Allows you to select dietary restrictions (Vegan, Vegetarian, etc.) and specific allergens.
- View your personalized nutritional dashboard.
- Displays your current recorded age, weight, and height.
- Shows your calculated TDEE (Total Daily Energy Expenditure) based on your fitness goals.
- Breaks down calorie targets for each meal (e.g., Breakfast, Lunch, Dinner) according to your chosen split.
Get a personalized AI-generated meal recommendation based on your profile and live dining hall menus.
- hall: Choose the Dining Hall (
MissouriorRyle Hall). - when: Select the menu date (
TodayorTomorrow). - meal_type: Select the specific meal (
Breakfast,Lunch, orDinner).
Example:
/meal hall:Ryle when:Today meal_type:Dinner
Permanently wipe your data from the TruMeals database.
- This action is irreversible and removes all physical stats, dietary preferences, and account links.
Displays an interactive help menu with a quick overview of all available commands and bot features.
├── bot.py
├── cogs
│ ├── meal.py -> implemented /meal
│ ├── profile.py -> implemented /profile and /help
│ └── sign_up.py -> implemented /sign_up and /delete
├── load_env.py
├── requirements.txt
├── sec.env
└── utils
├── ai_eval.py
├── db_handler.py
├── enums.py
├── fetch_data.py
├── filter_data.py
├── food_item.py
├── __init__.py
├── renderer.py
└── user_profile.py
- Python 3.12+
- Discord.py – Discord bot framework
- Supabase – Realtime Postgres database
- asyncio – Async tasks, loops, polling
- Sodexo-API - Through it's website's network tab
| Component | Role | Deployment |
|---|---|---|
bot.py |
Main Discord bot runtime | RailWay (Bot Host) |
Follow these steps to get a development instance of TruMeals running locally.
- Git
- A Supabase project (Free tier works)
- Discord Application (Bot Token + Client ID)
- Sodexo API, you can just scrape it from one of their websites displaying menues
Fork the repository to your GitHub account, then clone it to your local machine:
# Replace 'YOUR_USERNAME' with your GitHub username
git clone [https://github.com/YOUR_USERNAME/TruMeals.git]
cd TruMealsCreate a file named sec.env in the root directory. Copy and paste the following template, filling in your specific API keys:
# --- External APIs (Data Fetching) ---
SODEXO_API_KEY= # Extracted from Truman's Dining site; used for daily menu JSON.
GEMINI_URL= # Full Google AI endpoint (API Key already appended).
# --- Discord Configuration ---
DISCORD_TOKEN= # Private bot token from the Discord Developer Portal.
TRUMEALS_ID= # The Guild (Server) ID for development and testing.
# --- Database (Supabase) ---
SUPABASE_URL= # Your specific Supabase project API URL.
SUPABASE_KEY= # The public 'anon' key for database access and auth.
-
Log in to your Supabase Dashboard.
-
Go to the SQL Editor.
-
Open the file
utils/schema.txtlocated in the root of this repository and run it on Table Editor in SupaBase
pip install -r requirements.txt
python bot.py