A starter template for Telegram bots on Serverless, with Vercel, Netlify, and more support.
Built top of Nitro and Telegraf.
- Create a bot with @BotFather, and get the bot token.
- Clone this repo.
- Run
pnpm install
to install dependencies. - Copy
.env.example
to.env
, and fill in theBOT_TOKEN
andTOKEN
in.env
. - Run
pnpm dev
to 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
/start
to your bot.
- Deploy on Vercel, Netlify or others, with
BOT_TOKEN
andTOKEN
environment variables. - Visit https://your-domain.com/set-webhook?token=TOKEN
- Send
/start
to your bot.
Thanks to the project jsjoeio/telegram-bot-template.
MIT License © 2024 三咲智子 Kevin Deng