A free, fully-automated Telegram bot that helps users plan their daily study schedule with interactive prompts and automatic 7 AM reminders.
Live Features:
- ✅ Manual
/startcommand for testing anytime - ✅ Interactive 4-slot subject selection via buttons
- ✅ Auto-generated personalized timetables
- ✅ Daily 7 AM automatic reminders (when configured)
- Open Telegram and search for "BotFather"
- Type
/newbot - Copy your API Token
# Create .env.local
TELEGRAM_BOT_TOKEN=your_token_here
CRON_SECRET=any-secret-key
# Install and run
npm install
npm run dev- Search for your bot on Telegram
- Click Start or type
start - Select subjects for each time slot
- See your timetable appear!
- QUICK_START.md - 5-minute setup guide
- TELEGRAM_BOT_SETUP.md - Complete guide with all details
- CRON_SETUP.md - Setting up daily 7 AM reminders
Telegram User
↓
Telegram Bot API
↓
Your Bot (Next.js)
├── /api/telegram → Receives messages & button clicks
├── /api/cron/schedule → Sends daily 7 AM reminders
├── lib/telegram-bot.ts → API wrapper
├── lib/schedule.ts → Data management
└── lib/handlers.ts → Message logic
- Slot 1: 8:30 AM - 11:00 AM
- Slot 2: 12:10 PM - 2:00 PM
- Slot 3: 2:40 PM - 5:40 PM
- Slot 4: 7:30 PM - 10:00 PM
- Aerodynamics
- Space Dynamics
- Propulsion
- Structures
- Flight Mechanics
- Mathematics
- Aptitude
- Gas Dynamics
- Fluid Mechanics
Required:
TELEGRAM_BOT_TOKEN=your_bot_token_from_botfather
CRON_SECRET=your-secret-key-for-cron-endpoint
See .env.example for reference.
lib/
├── telegram-bot.ts # Telegram API client
├── schedule.ts # Schedule data & logic
└── handlers.ts # Message & button handlers
app/
├── page.tsx # Setup dashboard
└── api/
├── telegram/route.ts # Webhook endpoint
└── cron/schedule.ts # Daily 7 AM trigger
QUICK_START.md # 5-minute setup
TELEGRAM_BOT_SETUP.md # Full guide
CRON_SETUP.md # Cron configuration
.env.example # Environment template
/start → Select Slot 1 → Select Slot 2 → Select Slot 3 → Select Slot 4 → ✅ Timetable
7:00 AM (Cron) → "Good morning!" → Slot selection prompt → Same flow as above
- Push to GitHub
- Import to Vercel
- Add environment variables
- Bot is live!
Any platform supporting Node.js (Heroku, Railway, AWS Lambda, etc.)
Choose one of these free services:
- Sign up at cron-job.org
- Create cronjob pointing to
/api/cron/schedule - Set time to 7:00 AM daily
- Add header:
x-cron-secret: your-secret-key
- Sign up at upstash.com
- Create QStash schedule
- Cron:
0 7 * * * - Add same header as above
- Never commit
.env.local(use.env.example) - Use
x-cron-secretheader to protect cron endpoint - Only webhook endpoint accepts Telegram messages
- In production, use a database instead of in-memory storage
Edit lib/schedule.ts:
const SLOTS = [
{ name: 'Slot 1', time: 'Your time here' },
// ...
];Edit lib/schedule.ts:
const SUBJECTS = ['Your', 'Subjects', 'Here'];Replace userSelections object in lib/schedule.ts with database queries.
- Check webhook is set (BotFather →
/mybots) - Ensure URL is HTTPS (not HTTP)
- Check Vercel logs for errors
- Verify cron job is enabled in your service
- Check
x-cron-secretheader matches - Test with "Force Execution"
- User needs to type
/startto reset and try again
Free to use and modify.
Questions? Check the detailed guides or Telegram Bot API documentation.