Skip to content

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

License

Notifications You must be signed in to change notification settings

estevao90/busgv_bot

Repository files navigation

busgv_bot

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

GitHub license Tests Release

Instalação do Serverless Framework

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

# Instalando autocomplete
sls config tabcompletion install

Ambiente de DEV

# Pipenv
pipenv install --dev

Deploy

# 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

# Registrar webhook
curl https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/setWebHook?url=<ENDPOINT_AWS>

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

Desenvolvimento

# 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=<result[-1].update_id + 1>

Testes

# Ambiente pipenv
pipenv shell

# Executando testes
python -m pytest -v

Comandos úteis

# Testar função na AWS
sls invoke -f <function> [-p <event_file_path> -x <context_file_path>]

# Testar função localmente
sls invoke local -f <function> [-p <event_file_path> -x <context_file_path>]

# Lint
pylint funcs/* app/*

About

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

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages