Skip to content

BePolinochka/krestikinoliki

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Telegram Bot Template for Vercel Serverless Functions

📖 Documentation for grammY

What does this template do for you

1. Instant prototyping

Just click the blue button and change something in src/bot.mjs in newly minted repository

2. Universal bootstrap

Use webhooks or long polling locally, even without a Vercel project or CLI

3. Ready for production

Webhooks will be automatically installed for every deployment on Vercel during the build step

How to Use

You can choose from one of the following two methods to use this repository:

One-Click Deploy

Deploy the template using Vercel:

Deploy with Vercel

Clone and Deploy

Select the appropriate option and deploy it to the cloud with Vercel

As Vercel project

Please note that you will need to create a Vercel project and set the bot token in the settings

Using long polling
npm run polling
Using webhooks with CloudFlare tunnel (cloudflared) :
npm run webhook

And open link from terminal (ends with *.trycloudflare.com) to set webhooks URL

If you want another tunnel, just use vercel dev

As local project

Set environment variable or create .env file:

TELEGRAM_BOT_TOKEN="Telegram Bot Token from t.me/BotFather"

Run in long polling mode:

npm run start

💡 This command does not require a Vercel account or CLI installation to run

Environment variables

  • TELEGRAM_BOT_TOKEN — Telegram bot token from @BotFather
  • TELEGRAM_SECRET_TOKENSecret token for incoming requests

Template structure

Related templates

Made with 💜 by Vladislav Ponomarev