Telegram Bot Template for Vercel
This template is built on the grammY, thanks to which it supports both Serverless (Node.js) and Edge Runtime.
... and follow the instructions on next page.
... and connect the repository to your project on Vercel.
... and run the bot locally.
- Install dependencies (
npm i
) and link Vercel project - Pull
envs from Vercel (
npm run env
) or set them in a.env
file - Run the bot
in polling mode (
npm start
) or use the Vercel dev server
When you push a commit to a GitHub repository, Vercel runs build script and assigns a unique URL that will be set as the URL for incoming webhooks.
Until you run the bot locally, your code will run on the Vercel side, where you can view runtime logs and usage.
Telegram bot token from @BotFather (required)
TELEGRAM_BOT_TOKEN = "..."
Secret token for incoming requests (optional)
TELEGRAM_SECRET_TOKEN = "..."
Made with 🌚 by Vladislav Ponomarev