Telegram bot that accepts a dish name (even misspelled), resolves it to a canonical dish, and returns:
- 1 photo (optionally a 2-photo collage)
- a concise recipe (ingredients + steps)
- a relevant YouTube video link
Designed with clean architecture (ports/adapters) to be maintainable and extensible.
In Telegram:
- Use
/recipe <dish>(misspellings are ok). If the bot is unsure, it will show “Did you mean…?” buttons. - /help: usage + tips
- /recipe : fetch recipe + photo + YouTube link
- /prefs: set units/servings/diet
- /allergens milk,peanut: set allergens (adds warnings when matched)
- /allergens clear: clear allergens
Use BotFather and set:
TELEGRAM_BOT_TOKEN
Create a project in Google Cloud and enable YouTube Data API v3, then set:
YOUTUBE_API_KEY
The bot still works without it, but video search will be skipped.
Copy .env.example to .env and fill values.
python -m venv .venv
.venv\\Scripts\\activate
pip install -e ".[dev]"
python -m recipe_botThis project supports webhook mode (recommended for production) or long polling.
See .env.example for settings.
Telegram cannot send two separate photos in a single message update (it uses an album, which is multiple messages). If you want “1 update with 2 photos”, enable the collage option to merge 2 images into one.