umbrello-bot/README.md

94 lines
2.1 KiB
Markdown
Raw Normal View History

2020-05-19 15:28:41 +02:00
<h1 align="center">Welcome to umbrello-bot ☂️</h1>
<p>
<a href="https://github.com/franjsco/umbrello-bot/blob/master/LICENSE" target="_blank">
<img alt="License: GPL--3.0--or--later" src="https://img.shields.io/github/license/franjsco/umbrello-bot" />
</a>
<a href="https://twitter.com/franjsco" target="_blank">
<img alt="Twitter: franjsco" src="https://img.shields.io/twitter/follow/franjsco.svg?style=social" />
</a>
</p>
2019-08-26 17:19:52 +02:00
2020-05-19 15:28:41 +02:00
> A telegram bot to know if you need to take the umbrella.
2019-08-26 17:19:52 +02:00
2020-05-19 15:28:41 +02:00
<img src="screenshot.jpg">
2019-08-26 17:19:52 +02:00
2020-05-19 15:28:41 +02:00
## Install
2019-08-26 17:19:52 +02:00
2020-05-19 15:28:41 +02:00
1. Install Node.js and npm.
2. Install MongoDB.
3. Configure [umbrello-api](https://github.com/franjsco/umbrello-api).
4. Clone this repository.
5. Install dependencies with `npm install`.
6. Create a new bot with **@BotFather** on Telegram
7. Create env file or set environment variables (read: "Environment variables")
8. Build the code with `npm run build`.
9. Launch the bot with `npm run serve`.
2019-08-26 17:19:52 +02:00
2020-05-19 15:28:41 +02:00
#### Environment Variables.
```sh
NODE_ENV=production
TELEGRAM_TOKEN=token-here
UMBRELLO_API_URL=url-here
2019-08-26 17:19:52 +02:00
2020-05-19 15:28:41 +02:00
DB_HOST=mongodb://host:port/db
DB_USER=user
DB_PASSWORD=pass
```
2019-08-26 17:19:52 +02:00
## Usage
2020-05-19 15:28:41 +02:00
#### 1. Search the city.
2019-08-26 17:19:52 +02:00
Search the city id with:
```
/search [city name]
```
*example: `/search Roma`*
It will send back the cities id.
2020-05-19 15:28:41 +02:00
#### 2. Set the city.
2019-08-26 17:19:52 +02:00
Set the city wth:
```
/set [city id]
```
*example: `/set 3169070`. (3169070= Rome, IT)*
2020-05-19 15:28:41 +02:00
#### 3. Get the forecasts.
2019-08-26 17:19:52 +02:00
Get the forecasts with:
```
/get
```
## Build Docker image
```
2019-08-26 17:47:47 +02:00
# cd umbrello-bot/
2019-09-05 18:46:16 +02:00
# docker build -t umbrello-bot .
# docker run umbrello-bot
2019-08-26 17:19:52 +02:00
```
2020-05-19 15:28:41 +02:00
## Author
👤 **franjsco (Francesco Esposito)**
* Website: https://franjsco.github.io/
* Twitter: [@franjsco](https://twitter.com/franjsco)
* Github: [@franjsco](https://github.com/franjsco)
## Show your support
Give a ⭐️ if this project helped you!
## 📝 License
Copyright © 2020 [franjsco (Francesco Esposito)](https://github.com/franjsco).<br />
This project is [GPL--3.0--or--later](https://github.com/franjsco/umbrello-bot/blob/master/LICENSE) licensed.
2019-08-26 17:19:52 +02:00
2020-05-19 15:28:41 +02:00
***
_This README was generated with ❤️ by [readme-md-generator](https://github.com/kefranabg/readme-md-generator)_