A starter template for Telegram bots on Serverless, with Vercel, Netlify, and more support.
Built top of Nitro and grammY.
- Create a bot with @BotFather, and get the bot token.
- Clone this repo.
- Run
pnpm installto install dependencies. - Copy
.env.exampleto.env, and fill in theBOT_TOKENandTOKENin.env. - Run
pnpm devto start the development server. - Expose your local server to the internet with Local Port Forwarding of VSCode (set Port Visibility to Public) or ngrok.
- Visit https://your-domain.com/set-webhook?token=TOKEN
- Send
/startto your bot.
- Deploy on Vercel, Netlify or others, with
BOT_TOKENandTOKENenvironment variables. - Visit https://your-domain.com/set-webhook?token=TOKEN
- Send
/startto your bot.
Thanks to the project jsjoeio/telegram-bot-template.
MIT License © 2024 三咲智子 Kevin Deng