mirror of
https://github.com/codingCoffee/cowin-monitor.git
synced 2025-12-11 03:07:02 +00:00
fix: alert on bad response
Signed-off-by: Ameya Shenoy <shenoy.ameya@gmail.com>
This commit is contained in:
parent
bdd4bd28e1
commit
9afcfa664f
1 changed files with 5 additions and 1 deletions
6
app.py
6
app.py
|
|
@ -28,6 +28,7 @@ def main():
|
|||
message_header = "Atleast 1 new slot seems to have just opened up for vaccination.\n\n"
|
||||
message_footer = "Visit [this link](https://selfregistration.cowin.gov.in/appointment) to book a slot for yourself."
|
||||
|
||||
bot = telegram.Bot(token=TELEGRAM_BOT_TOKEN)
|
||||
logger.info('Initiating loop')
|
||||
while True:
|
||||
logger.info('Hitting CoWIN API')
|
||||
|
|
@ -51,8 +52,11 @@ def main():
|
|||
'fee_type': center.get('fee_type'),
|
||||
}
|
||||
available_center_list.append(curr)
|
||||
else:
|
||||
logger.info(response)
|
||||
msg = "Cowin API is giving a bad response"
|
||||
bot.sendMessage(chat_id=TELEGRAM_CHAT_ID, text=msg, parse_mode='markdown')
|
||||
|
||||
bot = telegram.Bot(token=TELEGRAM_BOT_TOKEN)
|
||||
message_body = ''
|
||||
if available_center_list:
|
||||
for center in available_center_list:
|
||||
|
|
|
|||
Loading…
Reference in a new issue