Bot do Telegram que informa os horários de saída dos ônibus da Grande Vitória - ES
# Instalando serverless
# Necessário Node
sudo npm install -g serverless
# Instalando autocomplete
sls config tabcompletion install
# Pipenv
pipenv install --dev
# 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
# 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
# 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>
# Ambiente pipenv
pipenv shell
# Executando testes
python -m pytest -v
# 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/*