mirror of
https://github.com/codingCoffee/cowin-monitor.git
synced 2025-12-12 11:47:01 +00:00
feat: send alert only for 18+
Signed-off-by: Ameya Shenoy <shenoy.ameya@gmail.com>
This commit is contained in:
parent
bfd93ed277
commit
24b1dd0246
1 changed files with 4 additions and 3 deletions
7
app.py
7
app.py
|
|
@ -56,14 +56,15 @@ def main():
|
||||||
message_body = ''
|
message_body = ''
|
||||||
if available_center_list:
|
if available_center_list:
|
||||||
for center in 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 Capacity: {center.get('available_capacity')}
|
||||||
Available Slots: {center.get('available_slots')}
|
Available Slots: {center.get('available_slots')}
|
||||||
Vaccine: {center.get('vaccine')}
|
Vaccine: {center.get('vaccine')}
|
||||||
Age Limit: {center.get('min_age_limit')}
|
Age Limit: {center.get('min_age_limit')}
|
||||||
Fee: {center.get('fee_type')}\n\n"""
|
Fee: {center.get('fee_type')}\n\n"""
|
||||||
message_body += msg
|
message_body += msg
|
||||||
break # to prevent too long messages
|
break # to prevent too long messages
|
||||||
msg = message_header + message_body + message_footer
|
msg = message_header + message_body + message_footer
|
||||||
bot.sendMessage(chat_id=TELEGRAM_CHAT_ID, text=msg, parse_mode='markdown')
|
bot.sendMessage(chat_id=TELEGRAM_CHAT_ID, text=msg, parse_mode='markdown')
|
||||||
time.sleep(SLEEP_TIME_SEC)
|
time.sleep(SLEEP_TIME_SEC)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue