Compare commits

...

5 Commits

Author SHA1 Message Date
Francesco Esposito 058cc2d743
Merge pull request #7 from franjsco/dependabot/npm_and_yarn/axios-0.21.1
Bump axios from 0.19.2 to 0.21.1
2021-02-13 17:45:10 +01:00
dependabot[bot] fd840eff3e
Bump axios from 0.19.2 to 0.21.1
Bumps [axios](https://github.com/axios/axios) from 0.19.2 to 0.21.1.
- [Release notes](https://github.com/axios/axios/releases)
- [Changelog](https://github.com/axios/axios/blob/v0.21.1/CHANGELOG.md)
- [Commits](https://github.com/axios/axios/compare/v0.19.2...v0.21.1)

Signed-off-by: dependabot[bot] <support@github.com>
2021-01-05 21:33:52 +00:00
franjsco 40d04336ca update readme 2020-05-19 15:34:03 +02:00
franjsco eed9594e59 update readme & dependencies 2020-05-19 15:28:41 +02:00
Francesco Esposito c1d9224837 Edit username 2020-03-01 23:43:01 +01:00
6 changed files with 1273 additions and 1495 deletions

View File

@ -1,23 +1,44 @@
# umbrello-bot <h1 align="center">Welcome to umbrello-bot ☂️</h1>
An opensource telegram bot to know if you need to take the umbrella. <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>
<img src="assets/screenshot.png" height="400"> > A telegram bot to know if you need to take the umbrella.
<img src="screenshot.jpg">
**Technologies**: ## Install
- Node.js 1. Install Node.js and npm.
- Telegraf.js 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`.
#### Environment Variables.
```sh
NODE_ENV=production
TELEGRAM_TOKEN=token-here
UMBRELLO_API_URL=url-here
DB_HOST=mongodb://host:port/db
DB_USER=user
DB_PASSWORD=pass
```
## Usage ## Usage
**umbrello-bot** uses the [umbrello-api](https://github.com/frsposito/umbrello-api) to get weather information. #### 1. Search the city.
### 1. Search the city.
Search the city id with: Search the city id with:
``` ```
@ -29,7 +50,7 @@ Search the city id with:
It will send back the cities id. It will send back the cities id.
### 2. Set the city. #### 2. Set the city.
Set the city wth: Set the city wth:
``` ```
@ -39,39 +60,12 @@ Set the city wth:
*example: `/set 3169070`. (3169070= Rome, IT)* *example: `/set 3169070`. (3169070= Rome, IT)*
### 3. Get the forecasts. #### 3. Get the forecasts.
Get the forecasts with: Get the forecasts with:
``` ```
/get /get
``` ```
## Installation
### Step by step.
1. Install Node.js and npm.
2. Configure [umbrello-api](https://github.com/frsposito/umbrello-api).
3. Clone this repository.
4. Install dependencies with `npm install`.
5. Create a new bot with BotFather on Telegram
6. Create env file or set environment variables (read: "Environment variables")
7. Build the code with `npm run build`.
8. Launch the bot with `npm run serve`.
#### Environment Variables.
```
NODE_ENV=production
TELEGRAM_TOKEN=token-here
UMBRELLO_API_URL=url-here
DB_HOST=mongodb://host:port/db
DB_USER=user
DB_PASSWORD=pass
```
## Build Docker image ## Build Docker image
``` ```
# cd umbrello-bot/ # cd umbrello-bot/
@ -79,8 +73,22 @@ DB_PASSWORD=pass
# docker run umbrello-bot # docker run umbrello-bot
``` ```
## License ## Author
GPLv3
--- 👤 **franjsco (Francesco Esposito)**
Made with ❤️ by Francesco Esposito ([@frsposito](https://github.com/frsposito))
* 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.
***
_This README was generated with ❤️ by [readme-md-generator](https://github.com/kefranabg/readme-md-generator)_

Binary file not shown.

Before

Width:  |  Height:  |  Size: 592 KiB

2646
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -11,26 +11,26 @@
}, },
"repository": { "repository": {
"type": "git", "type": "git",
"url": "git+https://github.com/frsposito/umbrello-bot.git" "url": "git+https://github.com/franjsco/umbrello-bot.git"
}, },
"author": "frsposito", "author": "franjsco",
"license": "GPL-3.0-or-later", "license": "GPL-3.0-or-later",
"bugs": { "bugs": {
"url": "https://github.com/frsposito/umbrello-bot/issues" "url": "https://github.com/franjsco/umbrello-bot/issues"
}, },
"homepage": "https://github.com/frsposito/umbrello-bot#readme", "homepage": "https://github.com/franjsco/umbrello-bot#readme",
"devDependencies": { "devDependencies": {
"@babel/cli": "^7.5.5", "@babel/cli": "^7.8.4",
"@babel/core": "^7.5.5", "@babel/core": "^7.9.6",
"@babel/node": "^7.5.5", "@babel/node": "^7.8.7",
"@babel/preset-env": "^7.5.5", "@babel/preset-env": "^7.9.6",
"eslint": "^6.2.1", "eslint": "^6.8.0",
"eslint-config-airbnb-base": "^14.0.0", "eslint-config-airbnb-base": "^14.1.0",
"eslint-plugin-import": "^2.18.2", "eslint-plugin-import": "^2.20.2",
"nodemon": "^1.19.1" "nodemon": "^1.19.4"
}, },
"dependencies": { "dependencies": {
"axios": "^0.19.0", "axios": "^0.21.1",
"dotenv": "^8.0.0", "dotenv": "^8.0.0",
"mongoose": "^5.6.9", "mongoose": "^5.6.9",
"telegraf": "^3.32.0", "telegraf": "^3.32.0",

BIN
screenshot.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 145 KiB

View File

@ -11,7 +11,7 @@ export const welcomeTemplate = () => (
An opensource telegram bot to know if you need to take the umbrella. An opensource telegram bot to know if you need to take the umbrella.
Made with by @frsposito. Made with by @franjsco.
` `
); );