diff --git a/app.py b/app.py index fca8ec8..82eb99f 100644 --- a/app.py +++ b/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: