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.
- Host: GitHub
- URL: https://github.com/estevao90/busgv_bot
- Owner: estevao90
- License: mit
- Created: 2019-11-19T21:47:50.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-12-08T12:39:53.000Z (over 3 years ago)
- Last Synced: 2023-04-28T02:40:38.741Z (about 3 years ago)
- Topics: ceturb, gvbus, hacktoberfest, telegram
- Language: Python
- Homepage:
- Size: 84 KB
- Stars: 1
- Watchers: 1
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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
[](https://github.com/estevao90/busgv_bot/blob/master/LICENSE)
[](https://github.com/estevao90/busgv_bot/actions?query=workflow%3ATests)
[](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/*
```