An open API service indexing awesome lists of open source software.

https://github.com/estevao90/busgv_bot

Bot do Telegram que informa os horários de saída dos ônibus da Grande Vitória - ES.
https://github.com/estevao90/busgv_bot

ceturb gvbus hacktoberfest telegram

Last synced: 10 months ago
JSON representation

Bot do Telegram que informa os horários de saída dos ônibus da Grande Vitória - ES.

Awesome Lists containing this project

README

          

# busgv_bot

Bot do Telegram que informa os horários de saída dos ônibus da Grande Vitória - ES

[![GitHub license](https://img.shields.io/github/license/estevao90/busgv_bot.svg)](https://github.com/estevao90/busgv_bot/blob/master/LICENSE)
[![Tests](https://github.com/estevao90/busgv_bot/workflows/Tests/badge.svg)](https://github.com/estevao90/busgv_bot/actions?query=workflow%3ATests)
[![Release](https://github.com/estevao90/busgv_bot/workflows/Release/badge.svg)](https://github.com/estevao90/busgv_bot/actions?query=workflow%3ARelease)

## Instalação do Serverless Framework

```shell
# Instalando serverless
# Necessário Node
sudo npm install -g serverless

# Instalando autocomplete
sls config tabcompletion install
```

## Ambiente de DEV

```shell
# Pipenv
pipenv install --dev
```

## Deploy

```shell
# Criar arquivo .env com base em .env.default
# Indicar o valor das variáveis
cp .env.default .env

# Pipenv
pipenv shell

# Deploy na AWS
sls deploy

# Excluir deploy
sls remove
```

## Telegram

```shell
# Registrar webhook
curl https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/setWebHook?url=

# Verificar status do webhook
curl https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/getWebhookInfo
```

## Desenvolvimento

```shell
# Remover webhook
curl https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/deleteWebhook

# Obtendo mensagens
curl https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/getUpdates

# Para obter apenas as novas mensagens
curl https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/getUpdates?offset=
```

### Testes

```shell
# Ambiente pipenv
pipenv shell

# Executando testes
python -m pytest -v
```

## Comandos úteis

```shell
# Testar função na AWS
sls invoke -f [-p -x ]

# Testar função localmente
sls invoke local -f [-p -x ]

# Lint
pylint funcs/* app/*
```