Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:aitormagan/autocitamadrid-robot-…
Browse files Browse the repository at this point in the history
…handler into develop
  • Loading branch information
Aitor Magán committed Jul 27, 2021
2 parents a764471 + a9f4fb0 commit 51610b8
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ custom:
pro: "vaccine-notifications-pro"
throughput:
dev: 1
pro: 5
pro: 10
update_centres_time:
dev: 21600
pro: 1200
Expand Down
3 changes: 1 addition & 2 deletions src/checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ def notify(min_years, user_info):
max_year_of_birth = datetime.now().year - min_years
message = f"‼️ ¡Buenas noticias {user_info['name']}! El sistema de vacunación de la Comunidad de Madrid ya " \
f"permite pedir cita a gente nacida en {max_year_of_birth} o antes. 🏃 Corre y pide tu cita en 🔗 " \
f"https://autocitavacuna.sanidadmadrid.org/ohcitacovid/\n\n🤔 ¿Sabes que ahora puedo darte las " \
f"primeras citas disponibles? Simplemente di /mindate."
f"https://autocitavacuna.sanidadmadrid.org/ohcitacovid/"
send_text(user_info["user_id"], message)


Expand Down
7 changes: 3 additions & 4 deletions src/message_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ def handle_update(update):
elif message == "/subscribe":
answer = handle_subscribe(update)
elif message == "/mindate":
telegram_helpers.send_text(user_id, "⌛ Esto me puede llevar unos segunditos...")
answer = handle_min_date(update)
# telegram_helpers.send_text(user_id, "⌛ Esto me puede llevar unos segunditos...")
answer = "Perdoname 🙏, pero la Comunidad de Madrid ha cambiado el sistema para impedirme darte esta información 😓."
else:
answer = handle_generic_message(update)
except Exception:
Expand All @@ -60,8 +60,7 @@ def handle_start(update):
f"tu año de nacimiento!\n\nOtros comandos útiles:\n- /subscribe: 🔔 Crea una suscripción para " \
f"cuando puedas pedir cita para vacunarte\n- /help: 🙋 Muestra esta ayuda\n- /status: " \
f"ℹ️ Muestra si ya estás suscrito\n- /cancel: 🔕 Cancela la notificación registrada\n - /currentage: " \
f"📆 Muestra la edad mínima con la que puedes pedir cita\n - /mindate: 📆 Lista las primeras citas " \
f"disponibles en los distintos centros de vacunación."
f"📆 Muestra la edad mínima con la que puedes pedir cita"


def handle_cancel(update):
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/test_message_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ def test_given_min_date_when_handle_update_then_handle_min_date_called(handle_ge
}
})

telegram_helpers_mock.send_text.assert_any_call(user_id, handle_min_date_mock.return_value)
telegram_helpers_mock.send_text.assert_any_call(user_id, ANY)


@patch("src.message_handler.handle_min_date")
Expand Down Expand Up @@ -956,4 +956,4 @@ def test_given_0_month_modifier_when_get_spots_body_then_current_month_returned_
"anyo": 2021,
"horaInicio": "00:00",
"horaFin": "23:59"
}
}

0 comments on commit 51610b8

Please sign in to comment.