- Python 100%
| handlers | ||
| .gitignore | ||
| bot.py | ||
| db.py | ||
| README.md | ||
| requirements.txt | ||
| scheduler.py | ||
Potluck Bot
A Telegram bot for coordinating potluck dinners. Each group chat hosts one potluck — admins set the date and location, members claim dishes, and the bot tracks dietary restrictions so everyone knows what they can eat.
Features
- Admin controls — set the event date, time, and location with
/setmeet - Dietary restrictions — stored globally per user; set once and they follow you across any group using this bot
- Dish claiming —
/bringprompts you to confirm whether your dish meets each dietary restriction present in the group - Live menu —
/menushows every dish with personal ✅/❌/❓ indicators based on your restrictions - Dynamic checks — when a new restriction is added to the group, the bot DMs all dish bringers to confirm their items
- Reminders — the bot sends a group reminder and private DMs to attendees before the event
Setup
1. Get a Bot Token
Talk to @BotFather on Telegram to create a new bot and copy the token.
2. Install dependencies
pip install -r requirements.txt
3. Configure
cp .env.example .env
Edit .env:
BOT_TOKEN=your_token_here
REMINDER_HOURS_BEFORE=24 # how many hours before the event to send reminders
DB_PATH=dining_meet.db # SQLite file path
4. Run
python bot.py
Bot Commands
| Command | Who | Description |
|---|---|---|
/start |
Anyone | Register with the bot and set dietary restrictions |
/setdiet |
Anyone | Update your dietary restrictions |
/setmeet |
Admins only | Set the event date, time, and location |
/resetmeet |
Admins only | Clear the current meetup and start fresh |
/bring <dish> |
Anyone | Claim a dish and answer dietary restriction questions |
/removebring |
Anyone | Remove a dish you claimed |
/menu |
Anyone | See the full menu with personal eat-ability indicators |
/meetinfo |
Anyone | See event date, time, and location |
/attending |
Anyone | See who's coming and their dietary restrictions |
How It Works
Setting up a potluck
- Add the bot to your group chat — it will introduce itself and create a potluck entry for the channel.
- An admin runs
/setmeetand follows the prompts to set the date, time, and location. - Members run
/start(in a private DM with the bot) to register and set dietary restrictions.
Important: Members must DM the bot
/startat least once before it can send them private messages about dietary checks and reminders.
Claiming a dish
Run /bring Pasta Salad (or just /bring and the bot will ask). The bot shows a checklist of every dietary restriction held by any group member and asks whether your dish satisfies each one:
Does "Pasta Salad" meet these dietary needs?
? vegetarian [✓ Yes] [✗ No]
? gluten-free [✓ Yes] [✗ No]
? nut-free [✓ Yes] [✗ No]
[💾 Save]
Unanswered restrictions show as ❓ in the menu.
Viewing the menu
/menu shows every dish with a personal indicator:
🍽 Potluck — Menu
✅ = you can eat this ❌ = you cannot ❓ = unknown
✅ Pasta Salad (by Alice)
vegetarian ✓ | gluten-free ✗ | nut-free ✓
❓ Garlic Bread (by Bob)
vegetarian ✓ | gluten-free ? | nut-free ✓
✅ Fruit Salad (by Carol)
(no restriction info)
Dynamic restriction updates
If someone adds a new dietary restriction after dishes have already been claimed, the bot automatically DMs each dish bringer to ask whether their item meets the new restriction. The menu updates as answers come in.
Data Storage
All data is stored in a local SQLite file (dining_meet.db by default). The schema includes:
- users — Telegram user IDs, names, and dietary restrictions (global)
- meetups — one per channel; date, time, location set by admins
- attendees — who's participating in a given meetup
- items — dishes being brought
- item_restriction_checks — per-dish, per-restriction confirmation (yes/no/pending)
Deployment
The bot runs as a single process. For a persistent deployment, use a process manager:
# systemd example
[Unit]
Description=Potluck Bot
After=network.target
[Service]
WorkingDirectory=/path/to/dining-meet-bot
ExecStart=/usr/bin/python3 bot.py
Restart=always
[Install]
WantedBy=multi-user.target
Or with screen / tmux for a quick setup:
screen -S potluck-bot
python bot.py
# Ctrl+A D to detach