feat: send alert only for 18+

Signed-off-by: Ameya Shenoy <shenoy.ameya@gmail.com>
This commit is contained in:
Ameya Shenoy 2021-05-03 00:32:34 +05:30
parent bfd93ed277
commit 24b1dd0246
Signed by: codingcoffee
GPG key ID: F7D58AAC5DACF8D3

7
app.py
View file

@ -56,14 +56,15 @@ def main():
message_body = ''
if available_center_list:
for center in available_center_list:
msg = f"""Location: {center.get('location')}
if center.get('min_age_limit') < AGE:
msg = f"""Location: {center.get('location')}
Available Capacity: {center.get('available_capacity')}
Available Slots: {center.get('available_slots')}
Vaccine: {center.get('vaccine')}
Age Limit: {center.get('min_age_limit')}
Fee: {center.get('fee_type')}\n\n"""
message_body += msg
break # to prevent too long messages
message_body += msg
break # to prevent too long messages
msg = message_header + message_body + message_footer
bot.sendMessage(chat_id=TELEGRAM_CHAT_ID, text=msg, parse_mode='markdown')
time.sleep(SLEEP_TIME_SEC)