yosefMinda/tg-inline-mvp
0
Campaign Study Dashboard Bot
A Telegram bot that manages a 20-day study campaign via a single pinned dashboard message.
Setup
1. Get your credentials
2. Create the Airtable table
In your Airtable base, create a table named BotState with two fields:
Key— Single line text (this is the default primary field, just rename it)Value— Long text
3. Set up your storage channel
- Create a public Telegram channel (e.g.
@your_study_resources) - Go to Channel Settings → Restrict Saving Content → Enable
- Upload your PDFs and audio files as posts
- Copy each post's link (
t.me/your_study_resources/POST_NUMBER) - Paste those links into
MODULESinbot.py
4. Install and run
pip install -r requirements.txt
export BOT_TOKEN="your_bot_token"
export AIRTABLE_API_KEY="your_airtable_pat"
export AIRTABLE_BASE_ID="your_base_id"
python bot.py5. Add bot to your group
- Add the bot as an admin to your group (it needs pin message permission)
- Send
/startcampaign— this posts + pins the dashboard and starts the timer
Commands
How module unlocking works
The bot calculates which module is active purely from campaign_start date:
- Days 0–4 → Module 1
- Days 5–9 → Module 2
- Days 10–14 → Module 3
- Days 15–19 → Module 4
No cron job needed. Every button click re-checks the date live.
Free hosting options (to keep the bot running 24/7)
- Railway — free tier, deploy straight from GitHub
- Render — free tier web service (add a dummy HTTP endpoint to keep it alive)
- GitHub Actions — not ideal for a polling bot, but works for scheduled tasks
The simplest path: push this repo to GitHub → connect to Railway → set the 3 env vars → deploy.
