Multi-bot Telegram bot repository deployed on Vercel using webhooks.
- ✅ TypeScript
- ✅ Multiple bots in one repository
- ✅ Shared logic between local dev (polling) and production (webhooks)
- ✅ Zero-config Vercel deployment
- ✅ Easy webhook setup
- Motumbito Bot - A fun blessing bot
- Tipodecambio Bot - USD and EUR to PEN exchange rates
telegram-bots/
├── api/ # Vercel serverless functions (webhooks)
│ └── {bot-name}.ts
├── bots/ # Bot logic
│ └── {bot-name}.ts # Shared bot logic (used by both polling & webhook)
├── scripts/
│ ├── start-polling.ts # Generic polling script (works for all bots)
│ ├── setup-webhook.ts # Webhook setup utility
│ ├── setup-commands.ts # Telegram command menu registration
│ └── utils.ts # Shared script utilities
└── package.json
# Install dependencies
npm install
# Set up environment variables
cp .env.example .env
# Edit .env and fill in your bot tokens
# Run bot locally (polling mode)
npm run dev:motumbito- Connect your GitHub repo to Vercel
- Add environment variable in Vercel Dashboard:
MOTUMBITO_BOT_TOKEN= your bot token
- Deploy (automatic on git push)
- Set up webhook:
npm run setup-webhook:motumbito https://your-app.vercel.app/api/motumbito
- BOT_SETUP.md - How to add new bots
- DEPLOYMENT.md - Detailed deployment guide
npm run dev:motumbito # Run Motumbito bot locally
npm run setup-webhook:motumbito # Setup Motumbito webhook
npm run setup-commands:motumbito # Register Motumbito commands in Telegram UI
npm run type-check # Check TypeScript types
npm run deploy # Deploy to Vercel (CLI)See BOT_SETUP.md for detailed instructions.
Quick overview:
- Create
bots/your-bot.ts(shared logic) - Create
api/your-bot.ts(webhook) - Add scripts to
package.json - Add
YOUR_BOT_TOKENto environment variables - Register commands via
npm run setup-commands:your-bot
ISC