Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
PonomareVlad committed Oct 16, 2024
1 parent 396e83e commit a2ecb23
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 6 deletions.
27 changes: 22 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,29 @@
This template is built on the grammY framework, thanks to which it supports both
Serverless (Node.js) and Edge Runtime.

## How to use:
## How to use

### A. Click the Deploy button and follow the instructions on Vercel
### A. Click the [![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgit.luolix.top%2FPonomareVlad%2FgrammYVercel&env=TELEGRAM_BOT_TOKEN&envDescription=Telegram%20Bot%20Token%20from%20%40BotFather&envLink=https%3A%2F%2Fcore.telegram.org%2Fbots%2Ftutorial%23obtain-your-bot-token&project-name=telegram-bot&repository-name=telegram-bot&redirect-url=https%3A%2F%2Fgrammy.dev&demo-title=grammY&demo-description=Documantation%20for%20grammY&demo-url=https%3A%2F%2Fgrammy.dev&demo-image=https%3A%2F%2Fgrammy.dev%2Fimages%2FgrammY.png) button ...

[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgit.luolix.top%2FPonomareVlad%2FgrammYVercel&env=TELEGRAM_BOT_TOKEN&envDescription=Telegram%20Bot%20Token%20from%20%40BotFather&envLink=https%3A%2F%2Fcore.telegram.org%2Fbots%2Ftutorial%23obtain-your-bot-token&project-name=telegram-bot&repository-name=telegram-bot&redirect-url=https%3A%2F%2Fgrammy.dev&demo-title=grammY&demo-description=Documantation%20for%20grammY&demo-url=https%3A%2F%2Fgrammy.dev&demo-image=https%3A%2F%2Fgrammy.dev%2Fimages%2FgrammY.png)
... and follow the instructions on Vercel side

### B. Click the Use this template button and connect the repository to your project on Vercel
### B. Click the [Use this template](https://github.com/new?template_name=grammYVercel&template_owner=PonomareVlad) button ...

### C. Clone the template to your computer and run the bot locally
...
and [connect the repository to your project on Vercel](https://vercel.com/new)

### C. Clone the template to your host ...

... and run the bot locally

## Local development

1. Install dependencies (`npm i`)
2. Pull envs from Vercel (`npm run env`) or edit `.env`
3. Run bot in polling mode (`npm start`) or start `vercel dev` server

## Vercel deployment

When you push a commit to a GitHub repository, Vercel assigns it a unique URL
and runs `scripts/build.mjs`, where it will be assigned as the URL for incoming
webhooks
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"license": "MIT",
"scripts": {
"postprepare": "touch .env",
"env": "npx vc env pull .env",
"env": "npx vercel env pull .env",
"build": "node scripts/build.mjs",
"start": "node --watch --env-file=.env scripts/start.mjs"
},
Expand Down

0 comments on commit a2ecb23

Please sign in to comment.