https://github.com/jgcarrillo/joserrabot
Telegram bot for weather, public transport and reminders.
https://github.com/jgcarrillo/joserrabot
axios grammy javascript telegram telegram-bot typescript vercel
Last synced: 3 months ago
JSON representation
Telegram bot for weather, public transport and reminders.
- Host: GitHub
- URL: https://github.com/jgcarrillo/joserrabot
- Owner: jgcarrillo
- License: gpl-3.0
- Created: 2022-10-13T12:01:43.000Z (about 3 years ago)
- Default Branch: develop
- Last Pushed: 2023-06-05T16:27:42.000Z (over 2 years ago)
- Last Synced: 2025-03-23T18:15:46.667Z (7 months ago)
- Topics: axios, grammy, javascript, telegram, telegram-bot, typescript, vercel
- Language: TypeScript
- Homepage:
- Size: 3.5 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

Telegram bot made with NodeJS, TypeScript and GrammY to create reminders and check the weather
![]()
## Table of contents π
- [β¨ Explanation](#-explanation)
- [π Installation](#-installation)
- [π¨ Features](#-features)
- [π© Issues](#-issues)
- [πΈοΈ Vercel configuration](#-vercel-configuration)
- [π Contact](#-contact)### β¨ Explanation
If you want to start to chat with the bot, simply search in Telegram for _@larguebot_ or _@joserrabot_. At the moment, the bot **only support private chats**, so you won't be able to add the bot to a group chat. To change that, go to `BotFather`, select your bot and go to _Bot Settings_ and then _Allow Groups_.
### π 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/)
- Database of reminders with [Mongo Atlas Database](https://www.mongodb.com/atlas/database)
- Conversations with [GrammY Conversations](https://grammy.dev/plugins/conversations.html#simple-example)
- Internal [session storage](https://grammy.dev/plugins/session.html#sessions-and-storing-data-built-in)
- User authentication with custom password### π© Issues
[See this example](https://github.com/grammyjs/examples/tree/main/vercel-bot)
### πΈοΈ Vercel Configuration
Create a `vercel.json` file in your root folder and add the following:
```json
{
"functions": {
"api/bot.ts": {
"memory": 1024,
"maxDuration": 10
}
}
}
```This line `export default webhookCallback(bot, 'http');` at the end of the `bot.ts` file do the trick!
In vercel, set the following data:
- Output directory: `build`
- Install command: `npm install`Set then the **environment variables**. Later, create the webhook with the following command. **Be sure to use the domain to your application**, I mean, avoid `https://joserrabot-d140bs3z9-jgcarrillo.vercel.app/` with the numbers and create the webhook with `https://joserrabot.vercel.app/`.
- Set the webhook: `https://api.telegram.org/bot{bot-key}/setWebhook?url={host-url}`
In this case the correct url to create the webhook is `https://joserrabot.vercel.app/api/bot`. Don't forget to add the `/api/bot` at the end of the URL of Vercel.
Other useful commands are:
- Info about webhook: `https://api.telegram.org/bot{bot-key}/getWebhookInfo`
- Delete webhook: `https://api.telegram.org/bot{bot-key}/deleteWebhook`### π Contact
If you have some doubts or need to ask something about the project, feel free to reach me here:
- Twitter: [https://twitter.com/jgcarrillo](https://twitter.com/jgcarrillo_)
- LinkedIn: [https://es.linkedin.com/in/jgcarrilloweb](https://es.linkedin.com/in/jgcarrilloweb)
- Website: [https://jgcarrillo.com/](https://jgcarrillo.com/)