Skip to content

Commit

Permalink
feat: update README. The bot is not currently deployed. Only works in…
Browse files Browse the repository at this point in the history
… local mode
  • Loading branch information
jgcarrillo committed Nov 17, 2022
1 parent 9d05c19 commit a0a9e6d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ If you want to start to chat with the bot, simply search in Telegram for _@largu

### 🚀 Installation

- `git clone`. Main and develop branches are currently the same.
- Go to `bot.ts` and uncomment the `bot.start()` line.
- Comment the code below `bot.start()`.
- `npm run dev` to run development server (local).

### 🎨 Features

- Weather forecast with [Open Weather Map](https://openweathermap.org/)
Expand All @@ -29,13 +34,23 @@ If you want to start to chat with the bot, simply search in Telegram for _@largu

### 🚩 Issues

**I CAN'T DEPLOY THE SERVER RIGHT NOW**

For more information, there are some interesting links that may resolve the problem in a future or wait for a **better Vercel documentation in GrammY docs**.

- [WerhookCallback functions](https://github.com/grammyjs/grammY/tree/main/src/convenience)
- [Vercel Deno](https://github.com/vercel-community/deno)
- [An example with Supabase](https://grammy.dev/hosting/supabase.html). Maybe I cant extrapolate to Vercel.

### 🕸️ Vercel Configuration

- Set the webhook: `https://api.telegram.org/bot{bot-key}/setWebhook?url=host-url`
- Info about webhook: `https://api.telegram.org/bot{bot-key}/getWebhookInfo`
- Delete webhook: `https://api.telegram.org/bot{bot-key}/deleteWebhook`
- Set the webhook with Vercel: `curl -X POST https://api.telegram.org/bot{YOUR-BOT-TOKEN}/setWebhook -H "Content-type: application/json" -d '{"url": {"YOUR-DEPLOY-URL"}'`

If some Headers are required, you can pass another with `-H "X-Telegram-Bot-Api-Secret-Token: <bot-token>"`

### 💛 Contact

If you have some doubts or need to ask something about the project, feel free to reach me here:
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@
"description": "",
"main": "index.js",
"scripts": {
"server": "node build/bot.js",
"start": "nodemon build/bot.js",
"dev": "nodemon ./api/bot.ts",
"build": "tsc",
"build": "tsc -p tsconfig.json",
"clean": "rimraf build",
"lint": "eslint --fix ./api --ext .ts,.json",
"format": "prettier --write ./api"
Expand Down

0 comments on commit a0a9e6d

Please sign in to comment.